Intel® C++ Compiler for Windows* - Fatal link error LNK1104 when using Intel® C++ Compiler with Boost* libraries

When building an application that uses the Boost libraries with the Intel® C++ Compiler, you may get linker errors like the ones shown below due to incorrect libraries being linked to the application:

fatal error LNK1104: cannot open file 'libboost_thread-iw-mt-1_33_1.lib'
fatal error LNK1104: cannot open file 'libboost_thread-iw-1_33_1.lib'
...

The root cause is missing Boost libraries for the Intel® C++ Compiler.

The preferred solution is to recompile all required Boost libraries with the Intel® C++ Compiler (libraries with the infix "iw" are created because of this). However, this is not mandatory. The libraries provided for the different Microsoft Visual Studio* versions are safe to use as well. Perform the following steps to use them instead:

  1. Open the Boost configuration file "auto_link.hpp".
  2. Search for
    #elif defined(__ICL)
    
    
    						   // Intel C++, no version number:
    
    						#  define BOOST_LIB_TOOLSET "iw"
  3. Change "iw" depending on which Microsoft Visual Studio version you're using:

    "vc71": Microsoft Visual Studio .NET 2003
    "vc80": Microsoft Visual Studio 2005
    "vc90": Microsoft Visual Studio 2008
    "vc100": Microsoft Visual Studio 2010
    "vc110": Microsoft Visual Studio 2012
    "vc120": Microsoft Visual Studio 2013

  4. Rebuild your application to resolve the linker errors.
 
 
For more complete information about compiler optimizations, see our Optimization Notice.

Comments

Thank you for your feedback!

Thank you for your feedback! Yes, the best solution is to recompile the Boost libraries with the Intel® C++ Compiler. However, it is not always practical for users to recompile everything and not mandatory anyways. The Intel® C++ Compiler uses Microsoft Visual Studio* libraries as well and compatibility to the respective ABI is maintained. So, there shouldn't be problems with using the Boost libraries compiled with Microsoft Visual Studio* compiler. If you still find problems, please let us know.

I've updated the article above accordingly.


This is actually very bad

This is actually very bad advice. The correct way to fix this problem is to actually recompile the boost libraries using the Intel compiler.

Boost does check which compiler is being used and will enable/disable certain features. Using binaries built using the VC++ compiler might result in the best case a linker error and in the worst case strange behaviour during runtime.