Installation

Using the pre-built libraries with Visual C++ 8/9

If you develop at Visual Studio 2005 or 2008, you can simply use the pre-built linker libraries provided in the distribution. Extract all files to a place of your choice. A directory called "ASSIMP" will be created there. Add the ASSIMP/include path to your include paths (Menu->Extras->Options->Projects and Solutions->VC++ Directories->Include files) and the ASSIMP/lib/<Compiler> path to your linker paths (Menu->Extras->Options->Projects and Solutions->VC++ Directories->Library files). This is neccessary only once to setup all paths inside you IDE.

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.

Microsoft Compilers & STL

In VC8 and VC9 Microsoft has introduced some STL debugging features. A good example are improved iterator checks and various useful debug checks. Actually they are really helpful for debugging, but they're extremely slow. They're so extremely slow that they can make the STL up to 100 times slower (imagine a std::vector<T>::operator[] performing 3 or 4 single checks! scary ...).

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.

Building the library from scratch

To build the library on your own you first have to get hold of the dependencies. Fortunately, special attention was paid to keep the list of dependencies short. Unfortunately, the only dependency is boost which can be a bit painful to set up for certain development environments. Boost is a widely used collection of classes and functions for various purposes. Chances are that it was already installed along with your compiler. If not, you have to install it for yourself. Read the "Getting Started" section of the Boost documentation for how to setup boost. VisualStudio users can use a comfortable installer from http://www.boost-consulting.com/products/free. Choose the appropriate version of boost for your runtime of choice.

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.

Building without boost.

The Boost-Workaround consists of dummy replacements for some boost utility templates. Currently there are replacements for These implementations are very limited and are not intended for use outside ASSIMP. A compiler with full support for partial template specializations is required. To enable the workaround, put the following in your compiler's list of predefined macros:
#define ASSIMP_BUILD_BOOST_WORKAROUND

If you're working with the provided solutions for Visual Studio use the -noboost build configs.

ASSIMP_BUILD_BOOST_WORKAROUND implies ASSIMP_BUILD_SINGLETHREADED.
See the Single-threaded build section for more details.

Build with MAKE

To build Assimp with MAKE, navigate to the code directory and run
make
respectively
make -fmakefile.mingw
for mingw-make. For a -noboost-Build, append
NOBOOST=1

Single-threaded build

-- currently there is no difference between single-thread and normal builds --

DLL build

ASSIMP can be built as DLL. You just need to select a -dll config from the list of project configs and you're fine. Don't forget to copy the DLL to the directory of your executable :-)

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.

Building against STLport

If your compiler's default implementation of the STL is too slow, lacks some features, contains bugs or if you just want to tweak ASSIMP's performance a little try a build against STLport. STLport is a free, fast and secure STL replacement that works with all major compilers and platforms. To get it visit their website at <stlport.org> and download the latest STLport release. Usually you'll just need to run 'configure' + a makefile (see the README for more details). Don't miss to add <stlport_root>/stlport to your compiler's default include paths - prior to the directory where the compiler vendor's STL lies. Do the same for <stlport_root>/lib and recompile ASSIMP. To ensure you're really building against STLport see aiGetCompileFlags().
Usually building ASSIMP against STLport yields a better overall performance so it might be worth a try if the library is too slow for you.

Generated on Sat Apr 17 18:41:24 2010 for Assimp by  doxygen 1.5.8