I am working on a game that can be compiled on my machine, and run on most windows machine as long as you provide the .dll's with it.
I have been trying to get it to compile on my friends computer
The libraries we are using are:
Box2D
SFML
TGUI
JSONCPP
(These are the same steps that I did on my computer):
A friend wanted to join me, so we downloaded the source for each lib on his machine.
Built each set of libraries using CMake, release-shared, and debug-shared.
Tried to compile the project.
It compiles, but when it tries to run it crashes with one of two problems
1. If we don't include libgcc_s_sjlj-1.dll with the exe on his computer, the program crashes in the sfml graphics library (as indicated by the debugger).
2. If we try the libgcc_s_dw2-1.dll with the exe (instead of sjlj), the same crash happens as #1
3. If we include libgcc_s_sjlj-1.dll we get this:
The procedure entry point __gxx_personality_v0 could not be located in
the dynamic link library
(directory to the bin folder)\libBox2D.dll
I have seen this exact error before, but with libstdc++6, and that was due to not having the libstdc++6.dll built with the right exception model (DW2 vs SJLJ). Does anyone have any insight into why this would happen?
Other Details:
In C:\Program Files (x86)\CodeBlocks\MinGW\bin MY computer has libgcc_s_dw2-2.dll AND libgcc_s_sjlj-1.dll, where as HIS computer only has libgcc_s_dw2-1.dll
On my computer, the program requires the extra libraries (ones not created by the 4 I listed):
libgcc_s_sjlj-1.dll
libstdc++-6.dll
libsndfile-1.dll
openal32.dll
(Do I need to rebuild these also?)
We compiled and ran test code for Box2D and SFML separately. Both worked. So this isn't directly Box2D's or SFML's fault. Is there a way I can see which libraries are DW2 vs SJLJ? I'm confused as to how they could be different considering they were all built on his computer, but I was hoping to get some insight into how to fix this.
Actually yes if you fully build everything on each machine it should work.
3. If we include libgcc_s_sjlj-1.dll we get this:
The procedure entry point __gxx_personality_v0 could not be located in
the dynamic link library
(directory to the bin folder)\libBox2D.dll
This error means that you've mismatching DLLs, are you certain you've built this application with the compiler which shipped the used libgcc_s_sjlj-1.dll?
Other Details:
In C:\Program Files (x86)\CodeBlocks\MinGW\bin MY computer has libgcc_s_dw2-2.dll AND libgcc_s_sjlj-1.dll
I've only seen this (stupidly) done by the TDM builds, which I can't recommend at all.
Personally I'd suggest you get both the same compiler (for example this one (http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/4.9.1/threads-posix/dwarf/i686-4.9.1-release-posix-dwarf-rt_v3-rev1.7z/download)) and recompile everything. You then could essentially even just build it once and share the binaries if wanted.
To use CMake effectively your compiler should be found in PATH. If you don't want to add the MinGW directory in the global PATH, you can open a new command line (cmd) and add it to that command line "session" with:
set PATH=C:\Path\To\Your\MinGW\bin;%PATH%
Note that it has to point to the bin directory of your MinGW install. Then you can run CMake, if it's in PATH you can just enter cmake-gui otherwise you'll have to specify the full path.
Keep in mind that libwinpthread-1.dll is located in your MinGW\bin directory and if you ever use std::thread you'll also need to ship it (maybe even in other cases).
Btw. CMake's newest version is 3.0.x. ;)