Identifier 'SetDeviceWindow' not found

Monkey Forums/Monkey Beginners/Identifier 'SetDeviceWindow' not found

cgrossi(Posted 2015) [#1]
Hello.

I've downloaded the free version and I can't change the resolution for desktop game. Looking for an way to do that, I saw a function SetDeviceWindow, but when I try to use it, I get the message "Identifier 'SetDeviceWindow' not found". In the mojo.app documentation, that function doesn't appear. Why? Aint' the free version complete for desktop games?


therevills(Posted 2015) [#2]
I believe the free version which you download from this site is version 77a, SetDeviceWindow was added to 77c.

You can get the latest code from GitHub, you could try coping over the latest files from there over your "installed" free version - it might work... maybe ;)

https://github.com/blitz-research/monkey

https://github.com/blitz-research/monkey/archive/develop.zip


ImmutableOctet(SKNG)(Posted 2015) [#3]
If that command doesn't appear in the documentation, it's because you're running an older version of Monkey. Unfortunately, I don't think Mark's updated the online version on the website, so you'll need to view it locally. Which version of Monkey are you using? 'mojo.app' has had that command since V77(c). In general, you should be running the newest version you can get your hands on. Though, some may be marked as experimental, that tends to act more as a disclaimer than anything else. I recommend getting the newest build you can. At least on my account, the latest build is V82(b), which is pretty close to the experimental builds. At least right now, you should be able to grab that from the "Product Updates" section.

How can I build the latest version?
If a newer version isn't available for download, you could always build the compiler yourself. If the newest build doesn't support something you want, you can clone from GitHub (Hit the download button if you're lazy), from there, you can rebuild the programs in the "src" folder using your current version of Monkey. You'll want to build "trans" first, as it's Monkey's compiler, so it will ensure proper results when compiling everything else. Technically, you might only need to build 'trans'. After that, you just need to move over the modules from the repository (Drag and drop / replace the existing folder). If you owned Monkey, the only difference would be the close-source stuff, but you don't need to bother.


cgrossi(Posted 2015) [#4]
Hi, guys. Thank you for your help.

ImmutableOctet(SKNG), I did everything you said. I downloaded the 83a version and compiled "transcc_winnt". Then I moved all the modules, but when I try to compile a test file I'm doing, nothing happens... What am I doing wrong?

Thanks.


therevills(Posted 2015) [#5]
Whats your code?


ImmutableOctet(SKNG)(Posted 2015) [#6]
If you moved the executable you built into "bin", then named it "transcc_winnt.exe", it should work. The only thing like this I've come across is with MinGW versions that force dynamic linking. Basically, it would normally complain about a DLL being missing, but only if you start it yourself. Try running the executable you compiled by double clicking on it. If nothing happens, then it's probably not a linking issue.

To add to what therevills said, does recompiling the compiler work with the version you've built?


skid(Posted 2015) [#7]
cgrossi, If you are posting on these forums does that mean you have access to Product Updates if you click on your user name at the top right of this page?

I think the advise being given out here is a bit odd.


dawlane(Posted 2015) [#8]
As skid says. If you have access to Product updates then check for the latest version there. If you cannot and you were given a product code you will have to register it; thats in the same menu. The one thing than has not been mentioned is to build trans and some of the other tools you have to be able to use the C++Tool target.

Things to note.
The free version if I remember came with the MinGW compiler. The pro version doesn't and requires you to either copy over the MinGW directory from the free version or download and install a fresh copy of MinGW. The most popular and recommend version is from TDM-GCC. You will also need a working transcc as well as a working MinGW compiler for any github version you wish to build.

One way to build
Download the github sources, Do not copy anything from the github sources over to your already installed version. The first task is to rebuild the github source for trans as a C++Tool. You will find this it and the other tools in the src directory.
To use the command line to build, change directory to the installed MonkeyX bin directory and execute the command below. Remember to change the PATH_TO_SRC with the path to the extracted github directory.
transcc_winnt -build -target=C++_Tool -config=release -builddir=transcc.build -clean  +CPP_GC_MODE=0 PATH_TO_SRC\transcc.monkey

When built, it will output a folder called build within the github trans source directory. Inside this directory the resulting executable will be named main_winnt.exe. There is also a main.cpp file that can be used to port the compiler to other system architectures. Rename main_winnt.exe to transcc_winnt.exe and move it to the github source bin directory. You could use the rebuildAll.monkey file in the github source to build a program to do all the lot, but thats another story.
Once done, you can use the newly built version of transcc to rebuild the other tools in the the github sources. The process is the same for the other tools apart from Ted.
Note that mserver.monkey requires the GLFW3 target (Desktop_Game_(Glfw3)) and Ted requires the installation of Qt for Visual Studio along with Visual Studio (never could figure out why Ted wouldn't compile with MinGW).


therevills(Posted 2015) [#9]
Skid, what do you mean? Free users can sign up to this site these days to be part of the community and download the free version of MonkeyX.

We are trying to get cgrossi to try to manually update the free zip version with the source code on github... What is odd about that???


cgrossi(Posted 2015) [#10]
Guys, I'm very appreciated for your help, but, unfortunatelly, I can't make it work with the newest version. I downloaded it, compiled and created the "transcc_winnt" file, but can't make it work.. Does anyone have the newest version that can pass me?

Skid, when I access the products update, the only option I have is to download the 77a version.

Thanks.


cgrossi(Posted 2015) [#11]
Hey, dudes!! Anybody??? :-)


MikeHart(Posted 2015) [#12]
What is the content of line 270 of the file

yourMonkeyFolder/modules/mojo/app.monkey

in your installation?


cgrossi(Posted 2015) [#13]
mikehart. didn't see your post here... that's because your complain on the other post.. what version do you refer? at the 77a there is no line 270, you probably know :-). the 83a I have this: Function SetDeviceWindow:Void( width:Int,height:Int,flags:Int )

thanks


MikeHart(Posted 2015) [#14]
So, it should work.