Standalone build

Monkey Forums/Monkey Beginners/Standalone build

Raudius(Posted 2015) [#1]
How do I compile my application so that it can be run on other machines?

I tried just copying the Release file to my laptop and it wouldnt run. I had to copy a bunch of dlls (OpenAL32, some c++lib or something and another one) and install Monkey on it to make it run.

Is there a way to include all the necessary libraries or do I need to compile some other way?


Raudius(Posted 2015) [#2]
I found these requirments in the doc:
MinGW 4.8.1 or Microsoft Visual C++ Express 2010 (MSVC).
OpenAL Windows Drivers.


Is that what is required then? I havent had a chance to try it yet


Gerry Quinn(Posted 2015) [#3]
As far as I know, it's only OpenAL that needs to be considered. Unless you somehow misconfigured your C++ compiler to link dynamically, you shouldn't need any other DLLs.


Raudius(Posted 2015) [#4]
With just the OpenAL dll I was getting:
"The application was unable to start correctly (0x000007b). Click OK to close the application"

Then I installed Monkey and that went away and got replaced by another message demanding some dlls. Put them in the folder and it worked.

However I obviously dont want users to have to install Monkey. I have worked with Qt on this computer in the past maybe that has messed with the compiler? But wouldnt Qt and Monkey come with their own separate C++ compilers?


Danilo(Posted 2015) [#5]
Revihx wrote:
Then I installed Monkey and that went away and got replaced by another message demanding some dlls. Put them in the folder and it worked.

What DLL's were required? When compiling using VisualStudio, you probably need to add the
VC++ Runtime DLL's for the version you used (VS 2010 / 2012 / 2013).

You could check what DLL's are required using Dependency Walker.


dawlane(Posted 2015) [#6]
It would be more helpful if you actually listed the dll's, what version of Monkey you are using and which compiler version for Qt you installed.
If you used the MinGW version of Qt and installed the compiler that comes with it. Then I will have a wild guess that one of the dll's it's asking for would be libgcc_s_dw2-1. To remedy this problem, remove Qt, check the system environment variables and remove any parts for Qt/MinGW.
The compiler that comes with MonkeyX free is the TDM version of MinGW. The TDM version fixes the problem with the missing library, as well as adding support of building 64bit binaries. If you need to use MinGW then install this version. When installing any other tool that comes with a MinGW compiler, then you should disable the install MinGW option.

If you need to use Qt, I would suggest using one of the Visual Studio versions and install the required version of Visual Studio. I have never yet managed to get the MonkeyX IDE to compile with Qt/MinGW.
I should point out that MonkeyX will favour MinGW over Visual Studio if both are installed. Read the documentation about configuration option on how to disable this.

When you do distribute you application. You will need to distribute OpenAL and in the case of building with Visual Studio, a Visual Studio C++ Runtime installer. You can find an installer of OpenAL in the targets directory. Or you can build the OpenAL-Soft version which is easy when you install the GUI version of CMake.


Raudius(Posted 2015) [#7]
Thanks for your replies!

YES! One of them was libgcc_s_dw2-1.dll and the other was libstdc++-6.dll

I will proceed to remove Qt/MinGW since I'm no longer using it, and hopefully that fixes it :D
I really wouldn't have thought it to cause issues :/ tbh it would be kind of annoying were I actually using Qt

The compiler that comes with MonkeyX free is the TDM version of MinGW

I am using Monkey X Pro, I'm not sure if this changes anything.


dawlane(Posted 2015) [#8]
Monkey Pro doesn't come with any compiler, so you are free to use any that you wish.
Please be aware that the 64bit version of TDM/MINGW by default will build 64bit applications and isn't compatible with the version of OpenAL found the targets directory. So it's best to rebuild the OpenAL-Soft version. If you want to build solely for 32bit then either use the 32bit version or modify the Makefile in targats/glfw/template/gcc_winnt and add -m32 to CPPFLAGS and LDFLAGS.
TDM-GCC
OpenAL-Soft. There is also a version on source-forge


Raudius(Posted 2015) [#9]
I'm not used to messing with compilers :/

Ive been using the glfw3 target, since I assumed bigger meant better. Would it be better if I use the glfw2 target?

Here is my Makefile from targets/glfw3/template/gcc+winnt
Im assuming its using the GCC compiler and compiling for win64. How would I go about changing it so it compiles without linking dynamically or whatever it is doing now that causes my builds not to work?