HOW TO: Build desktop target

Martin

Well-known member
CX Code Contributor
3rd Party Module Dev
Tutorial Author
3rd Party Tool Dev
Joined
Jun 19, 2017
Messages
333
Windows

To build the desktop (GLFW3) target you need to install MinGW.

We recommend to use this MinGW build (TDM): https://www.cerberus-x.com/downloads/tdm-gcc-64.zip

Just unzip it, don't use the installer inside the unziped folder. Then in your Cerberus folder, open the file bin/config.winnt.txt and change the variable MINGW_PATH to the path where you've MinGW installed.

That's it. You should now be able to build desktop apps.

You can make more build adjustments in the targets folder config file: targets/glfw3/templates/config.cxs

GLFW_USE_MINGW - Set it to True to us MinGW, to False to use Visual Studio (currently not working!)
GLFW_GCC_MSIZE_WINNT - 64 for 64bit builds, 32 for 32bit builds


Mac OS

To build the desktop (GLFW3) target you need to install XCode.

That's it. You should now be able to build desktop apps.

You can make more build adjustments in the targets folder config file: targets/glfw3/templates/config.cxs
 
Last edited by a moderator:

dawlane

Well-known member
CX Code Contributor
Tutorial Author
Joined
Jun 21, 2017
Messages
1,040
When it comes to installation for Linux you should read monkey-linux-install-manual.tar.gz.
A lot of this is still relevant apart from the stuff about the Qt development libraries and building Ted.
 

Pakz

New member
Tutorial Author
Joined
Jul 20, 2017
Messages
12
There are a number of options in the installer for mingw that is linked to from inside cerebus. I am not sure what to select. I have selected the 64 bit and the c/c++ version(not all packages). I hope it works.

After installing I trie dto compile and got a error. It seems to point to the openal lib. I installed that. The message is : "
../openal/libs/Win64/OpenAL32.lib: error adding symbols: File in wrong format

collect2.exe: error: ld returned 1 exit status"

I am going to try to install the 32 bit version of mingw and see if that solves it.

I installed the 32 bit version and now get another error when compiling. "../main.cpp:1:0: sorry, unimplemented: 64-bit mode not compiled in"

I am going to try to install the official monkeyx and see if that works.

I installed the free monkeyX from itch and it compiles desktop without problems. It has mingw included so you do not need to install this at all. But this is the free version. It seems desktop is broken for me for now.
 
Last edited:

dawlane

Well-known member
CX Code Contributor
Tutorial Author
Joined
Jun 21, 2017
Messages
1,040
MinGW 5.x+ has a problem with .LIB files. You will need to do two things:
  1. Open the Makefile for gcc_winnt in the targets template directory and remove the -L paths option in LDFLAGS.
  2. Download the Windows binaries for OpenAL soft and install them system wide.
See second post here for more details.
 
Last edited:

muruba

New member
CX Code Contributor
3rd Party Module Dev
Tutorial Author
Patreon Silver
Joined
Jul 5, 2017
Messages
230
That's very good help, thanks for that!

But I am wondering that if MX 86 can compile fine then why CX is causing issues?
 

MikeHart

Administrator
CX Code Contributor
3rd Party Module Dev
3rd Party Target Dev
3rd Party Tool Dev
Joined
Jun 19, 2017
Messages
3,499
That's very good help, thanks for that!

But I am wondering that if MX 86 can compile fine then why CX is causing issues?

MX was 32 bit, we changed 99% to 64bit. That can cause some disturbance which hopefully will be iron out. But I am surprised.
I can compile just fine here, didn't need to change anything.

You are using the version we recomment? 4.9.2?
 

muruba

New member
CX Code Contributor
3rd Party Module Dev
Tutorial Author
Patreon Silver
Joined
Jul 5, 2017
Messages
230
Oh yes, works fine with your 4.9 version, sorry!
 

MikeHart

Administrator
CX Code Contributor
3rd Party Module Dev
3rd Party Target Dev
3rd Party Tool Dev
Joined
Jun 19, 2017
Messages
3,499
That version was used by MX too.
 

MikeHart

Administrator
CX Code Contributor
3rd Party Module Dev
3rd Party Target Dev
3rd Party Tool Dev
Joined
Jun 19, 2017
Messages
3,499
@Martin: How about shipping MingW with thew Windows installation in a sub folder and the config file already pointing to it so the windows user can run the GLFW target out of the box? The free Monkey version did that too. As Cerberus is basically free, I think it would be fine or? Or is the distribution on itch.io working against the license?
 

Dubbsta

Active member
Joined
Jul 13, 2017
Messages
208
hi, cant compile game. pls help

"D:/Program Files (x86)/Cerberus/bin/transcc_winnt" -target=Desktop_Game_(Glfw3) -config=Release "D:/Program Files (x86)/Cerberus/spacegame/spacegame.monkey"

TRANS cerberus compiler V2017-10-24

Parsing...

Semanting...

Translating...

Building...

g++ -m64 -O3 -DNDEBUG -Wno-free-nonheap-object -I../curl/include -I../glfw3/include -I../glfw3/src -I../openal/include -I../stb -I../zlib-1.2.8 -I../lpng1610 -c -o build/Release64/main.o ../main.cpp

g++ -m64 -s -LD:/Program Files (x86)/Cerberus/libs/Win64 -Wl,--subsystem,windows -o Release64/CerberusGame build/Release64/context.o build/Release64/egl_context.o build/Release64/init.o build/Release64/input.o build/Release64/monitor.o build/Release64/osmesa_context.o build/Release64/vulkan.o build/Release64/wgl_context.o build/Release64/win32_init.o build/Release64/win32_joystick.o build/Release64/win32_monitor.o build/Release64/win32_time.o build/Release64/win32_thread.o build/Release64/win32_window.o build/Release64/window.o build/Release64/stb_vorbis.o build/Release64/stb_image.o build/Release64/main.o -lcomdlg32 -lgdi32 -lopengl32 -lopenal32 -lws2_32

g++: error: Files: No such file or directory

g++: error: (x86)/Cerberus/libs/Win64: No such file or directory

Makefile:53: recipe for target 'Release64/CerberusGame' failed

mingw32-make: *** [Release64/CerberusGame] Error 1

TRANS FAILED: Error executing 'mingw32-make CCOPTS=" -m64 -O3 -DNDEBUG" LDOPTS=" -m64 -s -LD:/Program Files (x86)/Cerberus/libs/Win64" LIBOPTS=" -lopenal32" OUT="Release64/CerberusGame"', return code=2

Done.
 

muruba

New member
CX Code Contributor
3rd Party Module Dev
Tutorial Author
Patreon Silver
Joined
Jul 5, 2017
Messages
230
As something quick to try put Cerberus to a simpler folder structure without spaces. "Program Files (x86)" could be an issue, sorry this is just a guess from me.
 

Dubbsta

Active member
Joined
Jul 13, 2017
Messages
208
As something quick to try put Cerberus to a simpler folder structure without spaces. "Program Files (x86)" could be an issue, sorry this is just a guess from me.

thanks muruba i think that did it. so how do i find or turn it into an executable? dont know how to use the file. thanks
 

Harrison9149

New member
Joined
Sep 17, 2017
Messages
9
Is anyone aware of how to change the icon displayed in the window of a glfw3 game on windows?
 

MikeHart

Administrator
CX Code Contributor
3rd Party Module Dev
3rd Party Target Dev
3rd Party Tool Dev
Joined
Jun 19, 2017
Messages
3,499
Not via code. You need to change the exported project or with a resource hacker on the application.
 
Top Bottom