To use the library in your C++ project you have to include either <assimp.hpp> or <assimp.h> plus some others starting with <aiTypes.h>. If you set up your IDE correctly the compiler should be able to find the files. Then you have to add the linker library to your project dependencies. Link to <assimp_root>/lib/<config-name>/assimp.lib. config-name is one of the predefined project configs. For static linking, use release/debug. See the sections below on this page for more information on the other build configs. If done correctly you should now be able to compile, link, run and use the application. If the linker complains about some integral functions being defined twice you propably have mixed the runtimes. Recheck the project configuration (project properties -> C++ -> Code generation -> Runtime) if you use static runtimes (Multithreaded / Multithreaded Debug) or dynamic runtimes (Multithreaded DLL / Multithreaded Debug DLL). Choose the ASSIMP linker lib accordingly.
Please don't forget to also read the Microsoft Compilers & STL section on MSVC and the STL.
These security enhancements are - thanks MS! - also active in release builds, rendering ASSIMP several times slower. However, it is possible to disable them by defining
_HAS_ITERATOR_DEBUGGING=0 _SECURE_SCL=0
in the preprocessor options (or alternatively in the source code, just before the STL is included for the first time). ASSIMP's vc8 and vc9 configs enable these flags by default.
If you're linking statically against ASSIMP: Make sure your applications uses the same STl settings! If you do not, there are two binary incompatible STL versions mangled together and you'll crash. Alternatively you can disable the fast STL settings for ASSIMP by removing the 'FastSTL' property sheet from the vc project file.
If you're using ASSIMP in a DLL: It's ok. There's no STL used in the DLL interface, so it doesn't care whether your application uses the same STL settings or not.
Another option is to build against a different STL implementation, for example STlport. There's a special Building against STLport section which describes how to achieve this.
If you don't want to use boost, you can build against our "Boost-Workaround". It consists of very small (dummy) implementations of the various boost utility classes used. However, you'll loose functionality (e.g. threading) by doing this. So, if it is possible to use boost, you should use boost. See the NoBoost-Section later on this page for more details.
Once boost is working, you have to set up a project for the ASSIMP library in your favourite IDE. If you use VC2005 or VC2008, you can simply load the solution or project files in the workspaces/ folder, otherwise you have to create a new package and add all the headers and source files from the include/ and code/ directories. Set the temporary output folder to obj/, for example, and redirect the output folder to bin/. Then build the library - it should compile and link fine.
The last step is to integrate the library into your project. This is basically the same task as described in the "Using the pre-built libraries" section above: add the include/ and bin/ directories to your IDE's paths so that the compiler can find the library files. Alternatively you can simply add the ASSIMP project to your project's overall solution and build it inside your solution.
#define ASSIMP_BUILD_BOOST_WORKAROUND
ASSIMP_BUILD_BOOST_WORKAROUND implies ASSIMP_BUILD_SINGLETHREADED.
See the Single-threaded build section for more details.
code
directory and run make
make -fmakefile.mingw
NOBOOST=1
NOTE: Theoretically ASSIMP-dll can be used with multithreaded (non-dll) runtime libraries, as long as you don't utilize any non-public stuff from the code dir. However, if you happen to encounter *very* strange problems try changing the runtime to multithreaded (Debug) DLL.