C++ – Linker error LNK1104 with ‘libboost_filesystem-vc100-mt-s-1_49.lib’

boostc

During the process of linking my program to the boost::filesystem module in release mode I get the next error:

error LNK1104: cannot open file
'libboost_filesystem-vc100-mt-s-1_49.lib'

However, in the boost\stage\lib directory I only have the next libraries referred to filesystem module:

libboost_filesystem-vc100-mt-1_49.lib

libboost_filesystem-vc100-mt-gd-1_49.lib

My questions are:

Why does the VC++ is asking for 'libboost_filesystem-vc100-mt-s-1_49.lib?

Which compiler/linking properties should I change to get the compiler to ask for libboost_filesystem-vc100-mt-1_49.lib?

UPDATE: My VC2010++ solution has 2 projects that include the previous boost library: x is a library and y (the main program) which invokes to x.

  1. When I build x with Configuration type=Static library and RuntimeLibrary=Multi-threaded (/MT), it is ok.
  2. When I build y with Configuration type=Application (.exe) and RuntimeLibrary=Multi-threaded (/MT), it issues the error I indicated, if I change to Configuration type=Static library it builds ok, but my main program has .lib extension and not the expected .exe.

Best Answer

You are using /MT or /MTd option in C/C++/Code Generation/Runtime Library which require static library, boost default build with shared library output. You can switch Runtime Library to /MD or /MDd. An other option is recompile boost with static library output and you'll get 'libboost_filesystem-vc100-mt-s-1_49.lib'..

Related Topic