0

I am trying to build the boost.thread library for Visual Studio 9.0. I used bjam to build the lib-files:

bjam toolset=msvc-9.0 variant=release threading=multi link=shared

The compilation succeeded and I got plenty of .lib and .dll files under boost/stage/lib. Then I added include path and the above lib path to Visual Studio 9.0.

But when I try to compile some program, I always get the following error:

libboost_thread-vc90-mt-s-1_49.lib cannot be opened.

The lib file created by the build has slightly another name:

boost_thread-vc90-mt-1_49.lib

I tried to rename my file to match the expected name, but Visual Studio still cannot find the file. It seems that the filename beeing seaarched depends on the project option "C/C++ / Code generation / runtime library". I need the option "Multithreaded /MT".

What am I doing wrong?

Thank you in advance.

mbue
  • 1,591
  • 2
  • 14
  • 34

1 Answers1

0

You're trying to link statically with CRT, but dynamically - with Boost. This is not a good idea, but if you insist, you should define BOOST_ALL_DYN_LINK macro. Better option would be to select /MD in your project options, or to set "link=static" when building boost.

Igor R.
  • 14,716
  • 2
  • 49
  • 83
  • Thank you, now I compiled using link=static and I got the following library: libboost_thread-vc90-mt-1_49.lib. However, the Linker looks after libboost_thread-vc90-mt-s-1_49.lib (notice the s). Runtime library option is /MT. What am I doing wrong? – mbue Jun 11 '12 at 14:14
  • Add runtime-link=static. Also, take a look at the manual[1] [1]: http://www.boost.org/doc/libs/1_49_0/more/getting_started/windows.html#library-naming – Igor R. Jun 11 '12 at 15:51