Compile 64 bits ?

Monkey Forums/Monkey Programming/Compile 64 bits ?

DarkyCrystal(Posted 2016) [#1]
Hi there,

I wonder if there is a way to compile a game in 64 bits. I saw in the config file that we can put the path to mingw 64 and mingw 32.

But it seems that the compile fails. I have to "comment" the mingw 64 line to make the compilation works. I tried to change the 32 value in the template file to 64, that's better but when it tries to work with openAL the compilation fails again.

Have you got a way to make it work or it's definitively 32 bits mode ?

Thx and sorry for my english.


skid(Posted 2016) [#2]
I would create a github issue as it looks like the openal module needs a few tweaks to work with 64 bit on windows.


dawlane(Posted 2016) [#3]
To compile for 64 bit Windows you need:
1) A compiler capable of 64 bit compilation. Easy if you are using MinGW, but I should point out that version 5.1.0 maintained by TDM has a bug and cannot handle windows .lib files. The trick for that version would be to make a second directory for OpenAL libraries with the offending files removed and change the glfw gcc makefile template to point to it. Just make sure that you have a shared library for the correct system architecture within your redirected paths. If you are using the Visual Studio tool chain; then you will have to modify the Visual Studio template. Make sure that your MonkeyX config file points to the MinGW installations root directory.

2) A version of OpenAL compiled as a 64 bit shared library installed system wide or within the resulting MonkeyX application directory. Note: as far as I know there has never has been a 64 bit library released by Creative Labs and you should be very wary of downloading any from unofficial sources, be they 32 bit or otherwise. Creative Labs OpenAL has a bit of a history and was pretty much abandoned by Creative Labs. The alternative is to use OpenAL-soft; this version is incredibly easy to build with CMake installed, but some application expect to find the Creative Labs version of OpenAl32 and may have issues with OpenAL-soft, so you should install this version in your application directory.

I should point out that both the 32 bit and 64 bit must have the same name of OpenAL32.dll.

You can find the Creative Labs release at openal.org

3) Depending on the compiler you use and the version of MonkeyX, you would either have to modify the Visual Studio Project template or make a few changes to glfw gcc makefile template.

Later version of MonkeyX allow you to pass compiler options to MinGW without having to hack the makefile. If you have to hack the makefile, you need to add the compiler switch -m32 to both the makefile variable CPPFLAGS and LDFLAGS. You will find the global templates in targets/glfw2/template and the local copies in your projects .build directory.


DarkyCrystal(Posted 2016) [#4]
Thx, I use Mingw, I think this is the openAl 's problem. I'm going to look at OpenAL-soft...I use the latest version of monkey. It's a bit complicated ^^