Boost C++ Libraries: Ticket #12421: Even with BOOST_ALL_NO_LIB defined, VS14 linker looks for mt-s variant https://svn.boost.org/trac10/ticket/12421 <p> We do not use the default library names for boost. In fact, we only compile filesystem, system and date_time libraries. We define BOOST_ALL_NO_LIB, compile with b2 and rename the libraries to filesystem.lib, system.lib and date_time.lib for a static link with static linkage to standard lib. This worked for us for many Boost lib versions and different Visual Studio versions. With Boost 1.61 and Visual Studio 2015 (vc14), we receive the following error when linking a project to our renamed filesystem.lib for example: </p> <p> LINK : fatal error LNK1104: cannot open file 'libboost_filesystem-vc140-mt-s-1_61.lib' </p> <p> No matter if we even specify --layout=sytem as a build option to generate libboost_filesystem.lib: we still get a linkage error on the complete -vc140-mt-s-1_61 variant. </p> <p> Leaving both renamed libraries and boost named libraries in our library path fixes the issue. </p> <p> Why is Visual Studio 14.0 linker still using autolink features with boost 1.61, even though we specify boost not to use autolink (ie, we define BOOST_ALL_NO_LIB). </p> <p> We also get a macro redefinition warning when we define BOOST_ALL_NO_LIB in user.hpp header. It looks like it is correctly defined, but linker will still look for the -vc140-mt-s-1_61 variant of the library. </p> <p> I tried about all possibilities when compiling with b2, to no avail. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12421 Trac 1.4.3 anonymous Sat, 03 Sep 2016 05:38:04 GMT <link>https://svn.boost.org/trac10/ticket/12421#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12421#comment:1</guid> <description> <p> You have to define BOOST_ALL_NO_LIB when you compile your program, not when you compile Boost. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Tue, 06 Sep 2016 18:59:23 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12421#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12421#comment:2</guid> <description> <p> Duh! I understand what happened now: I was not responsible for distributing boost include directory and for compiling it that time... So boost was correctly compiled with the BOOST_ALL_NO_LIB define, but in the distributed headers, user.hpp in config was not modified to include BOOST_ALL_NO_LIB. </p> <p> Hence the difference between how boost library is compiled and how code using the library is. </p> <p> There is no bug here, just a stupid pilot error. </p> <p> This ticket can be closed. </p> </description> <category>Ticket</category> </item> </channel> </rss>