Hi, how can I compile Box2D with MinGW? I have CMake, MinGW and Box2D, but I do not know what to do now. 😕
How to compile the Box2D libraries with MinGW and CMake
Build IssuesGet to dir where u installed cmake.
Run bin/cmake-gui.exe
in window choose src folder as box2d src folder
In source dest choose box2d/build
Press configure and choose from list mingw.
Then choose radio button no. 2 from up.
In next window choose dest. Of gcc and g++ files ignore fortan ( thry are in mingw/bin folder)
Click ok.
In main window press generate and wait.
Paste log here 😀
Kitty
Run bin/cmake-gui.exe
in window choose src folder as box2d src folder
In source dest choose box2d/build
Press configure and choose from list mingw.
Then choose radio button no. 2 from up.
In next window choose dest. Of gcc and g++ files ignore fortan ( thry are in mingw/bin folder)
Click ok.
In main window press generate and wait.
Paste log here 😀
Kitty
If some1 can upload .a files and give a link? For minGW and 2.2.0.
It's probably better if you are able to build these yourself. Doesn't the cmake method in the source code download work for mingw?
If you have code::blocks (free cross platform IDE which can use mingw as the compiler) you can get project files for 2.2.0 here: http://www.iforce2d.net/b2dtut/setup-windows
You could build the .a using that.
If you have code::blocks (free cross platform IDE which can use mingw as the compiler) you can get project files for 2.2.0 here: http://www.iforce2d.net/b2dtut/setup-windows
You could build the .a using that.
I use dev c++ with mgw and i really need .a files bcs i cant built myself in some reason. Could you please cmake it? Are the files same as in codeblocks?
Please some1 upload it... I really need it.
I don't think that would really help you very much. You should solve the "for some reason" problem that you mentioned in the previous post.
I haven't used used devc++ but usually IDEs will have an option in the project settings to create a static link library. All you need to do is add all the box2d source files to the project, and set the search path for includes to also look in the main Box2D folder (one folder above the folder containing Box2D.h)
If devc++ and code:blocks both use mingw, I think the produced .a files would be compatible.
What is sbd by the way?
I haven't used used devc++ but usually IDEs will have an option in the project settings to create a static link library. All you need to do is add all the box2d source files to the project, and set the search path for includes to also look in the main Box2D folder (one folder above the folder containing Box2D.h)
If devc++ and code:blocks both use mingw, I think the produced .a files would be compatible.
What is sbd by the way?
sbd = somebody, and i cant build it for code::blocks and for mingw, becouse it always says:
any help?
I tried some other options, and as far i have:
Aw, i moved Mgw, when it was back it was ok, but other errors:
And meseagebox: cant find libgmp-10.dll... I checked, its in bin directory -.-
Code:
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Could not find cmake module file:E:/Box2D_v2.2.0/Box2D_v2.2.0/Box2D/Buildj/CMakeFiles/CMakeCCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Could not find cmake module file:E:/Box2D_v2.2.0/Box2D_v2.2.0/Box2D/Buildj/CMakeFiles/CMakeCXXCompiler.cmake
Configuring incomplete, errors occurred!
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Could not find cmake module file:E:/Box2D_v2.2.0/Box2D_v2.2.0/Box2D/Buildj/CMakeFiles/CMakeCCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Could not find cmake module file:E:/Box2D_v2.2.0/Box2D_v2.2.0/Box2D/Buildj/CMakeFiles/CMakeCXXCompiler.cmake
Configuring incomplete, errors occurred!
any help?
I tried some other options, and as far i have:
Code:
The C compiler identification is unknown
The CXX compiler identification is unknown
Check for working C compiler: c:/MinGW/bin/gcc.exe
CMake Error: your C compiler: "c:/MinGW/bin/gcc.exe" was not found. Please set CMAKE_C_COMPILER to a valid compiler path or name.
CMake Error: Internal CMake error, TryCompile configure of cmake failed
Check for working C compiler: c:/MinGW/bin/gcc.exe -- broken
CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
The C compiler "c:/MinGW/bin/gcc.exe" is not able to compile a simple test
program.
It fails with the following output:
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:3 (project)
CMake Error: your C compiler: "c:/MinGW/bin/gcc.exe" was not found. Please set CMAKE_C_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "c:/MinGW/bin/g++.exe" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
Configuring incomplete, errors occurred!
The CXX compiler identification is unknown
Check for working C compiler: c:/MinGW/bin/gcc.exe
CMake Error: your C compiler: "c:/MinGW/bin/gcc.exe" was not found. Please set CMAKE_C_COMPILER to a valid compiler path or name.
CMake Error: Internal CMake error, TryCompile configure of cmake failed
Check for working C compiler: c:/MinGW/bin/gcc.exe -- broken
CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
The C compiler "c:/MinGW/bin/gcc.exe" is not able to compile a simple test
program.
It fails with the following output:
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:3 (project)
CMake Error: your C compiler: "c:/MinGW/bin/gcc.exe" was not found. Please set CMAKE_C_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "c:/MinGW/bin/g++.exe" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
Configuring incomplete, errors occurred!
Aw, i moved Mgw, when it was back it was ok, but other errors:
Code:
The C compiler identification is unknown
The CXX compiler identification is unknown
Check for working C compiler: E:/MinGW/bin/gcc.exe
Check for working C compiler: E:/MinGW/bin/gcc.exe -- broken
CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
The C compiler "E:/MinGW/bin/gcc.exe" is not able to compile a simple test
program.
It fails with the following output:
Change Dir: E:/Box2D_v2.2.0/Box2D_v2.2.0/Box2D/Buildq/CMakeFiles/CMakeTmp
Run Build Command:c:/MinGW/bin/mingw32-make.exe "cmTryCompileExec/fast"
c:/MinGW/bin/mingw32-make.exe -f CMakeFiles\cmTryCompileExec.dir\build.make
CMakeFiles/cmTryCompileExec.dir/build
mingw32-make.exe[1]: Entering directory
`E:/Box2D_v2.2.0/Box2D_v2.2.0/Box2D/Buildq/CMakeFiles/CMakeTmp'
"C:\Program Files\CMake 2.8\bin\cmake.exe" -E cmake_progress_report
E:\Box2D_v2.2.0\Box2D_v2.2.0\Box2D\Buildq\CMakeFiles\CMakeTmp\CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj
E:\MinGW\bin\gcc.exe -o CMakeFiles\cmTryCompileExec.dir\testCCompiler.c.obj
-c
E:\Box2D_v2.2.0\Box2D_v2.2.0\Box2D\Buildq\CMakeFiles\CMakeTmp\testCCompiler.c
mingw32-make.exe[1]: ***
[CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj] Error 1
mingw32-make.exe[1]: Leaving directory
`E:/Box2D_v2.2.0/Box2D_v2.2.0/Box2D/Buildq/CMakeFiles/CMakeTmp'
mingw32-make.exe: *** [cmTryCompileExec/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:3 (project)
Configuring incomplete, errors occurred!
The CXX compiler identification is unknown
Check for working C compiler: E:/MinGW/bin/gcc.exe
Check for working C compiler: E:/MinGW/bin/gcc.exe -- broken
CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
The C compiler "E:/MinGW/bin/gcc.exe" is not able to compile a simple test
program.
It fails with the following output:
Change Dir: E:/Box2D_v2.2.0/Box2D_v2.2.0/Box2D/Buildq/CMakeFiles/CMakeTmp
Run Build Command:c:/MinGW/bin/mingw32-make.exe "cmTryCompileExec/fast"
c:/MinGW/bin/mingw32-make.exe -f CMakeFiles\cmTryCompileExec.dir\build.make
CMakeFiles/cmTryCompileExec.dir/build
mingw32-make.exe[1]: Entering directory
`E:/Box2D_v2.2.0/Box2D_v2.2.0/Box2D/Buildq/CMakeFiles/CMakeTmp'
"C:\Program Files\CMake 2.8\bin\cmake.exe" -E cmake_progress_report
E:\Box2D_v2.2.0\Box2D_v2.2.0\Box2D\Buildq\CMakeFiles\CMakeTmp\CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj
E:\MinGW\bin\gcc.exe -o CMakeFiles\cmTryCompileExec.dir\testCCompiler.c.obj
-c
E:\Box2D_v2.2.0\Box2D_v2.2.0\Box2D\Buildq\CMakeFiles\CMakeTmp\testCCompiler.c
mingw32-make.exe[1]: ***
[CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj] Error 1
mingw32-make.exe[1]: Leaving directory
`E:/Box2D_v2.2.0/Box2D_v2.2.0/Box2D/Buildq/CMakeFiles/CMakeTmp'
mingw32-make.exe: *** [cmTryCompileExec/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:3 (project)
Configuring incomplete, errors occurred!
And meseagebox: cant find libgmp-10.dll... I checked, its in bin directory -.-
ok, got it. moved copies of .dlls to all possible locations. 😛 compiled. where do i get .a files? ;D
Great! So you have the testbed running from this compile? The .a file for the main Box2D engine will probably be in the folder Box2D under the location where you ran make from. If not just search your hard drive 🙂
Original thread: https://box2d.org/forum/viewtopic.php?t=6731