How can I build Assimp with cMake and MinGW?
I tried, but I don't get a functioning library...
Details of my attempt:
I am trying to build the Open Asset Import Library (Assimp) but I have been running into problems. The assimp documentation is really poor and expects you to know exactly what you are doing. The developers haven't been particularly helpful either. I hope someone here has successfully built assimp and can let me know where I am going wrong. I suspect that I have several problems that are contributing to my failure. I am using 64 bit Windows 8.1 pro and using MinGW version 4.8.1.
The first thing I tried was downloading assimp 3.1.1 and boost 1.57. I extracted both folders and tried to use cMake to generate the makefile for MinGW. I haven't used cMake before and the assimp instructions are use cMake as you normally would, so I have no idea if I configured it right. I pointed BOOST_ROOT
to the boost folder I extracted from the download, set it to build static libraries and generated the makefile.
I then tried running the makefile and got a number of errors. The first was
IFCReaderGen.cpp.obj: too many sections and was too big.
After some googling, I found a workaround was to set CMAKE_BUILD_TYPE
to release
. That seemed to work and it finished the build but I only got the files assimp32.dll
and libassimp.dll.a
, which I thought was odd because I was expecting lib/relese/libassimp.a
to be generated as per the details on the assimp website. Though the website might also be wrong or out of date.
I linked with -lassimp.dll
and that allowed me to build my program. However it crashed upon start-up - the error that appeared immediately at start-up was
Program has stopped working
(There was no additional info.) I guessed that this was a dll problem—which was odd because I had (tried) to build the static libraries through cMake. I copied assimp32.dll
into my executable folder. This time, the program wouldn't crash but the screen would be blank. I'm guessing that there was something wrong with the library I build that was causing it to link incorrectly.
At this point, I deleted everything to try a fresh start. I tried to follow this article:
- I downloaded assimp 3.1.1 and boost 1.57 and extracted them.
I opened
cmd
, changed to the boost root directory and ranbootstrap.bat mingw
I then ran
b2 --build-dir="C:/Libraries/boost/" variant=release link=static address-model=32 toolset=gcc
The result of this was
598 targets updates, 3 targets skipped, 2 targets failed.
I now have a folder
C:\Libraries\boost\boost\bin.v2
with two folderslibs
andstandalone
, but I'm not certain what myBOOST_ROOT
directory is anymore.I opened cMake, selected the assimp folder I had extracted, and configured the following:
BOOST_ROOT = "C:/Libraries/boost/boost/" ASSIMP_BUILD_STATIC_LIB = TRUE ASSIMP_BUILD_TESTS = FALSE ASSIMP_ENABLE_BOOST_WORKAROUND = FALSE BUILD_SHARED_LIBS = FALSE
I then pressed
configure
and got the error that the boost libraries were not found.
I'm only guessing what these cMake settings do, as I can't find any documentation for assimp. I'd like to build some version of assimp that I can then link to and use in a simple test program. At some point I will go back and build the shared libraries, but first I just want to get something working and understand how to do it again.
Can someone see what has gone wrong?