0
votes

I would like to avoid building a whole library for just boost::Thread. So I added the cpp files in libs/Thread to my project and it worked under GCC on MacOS.

However, Visual Studio on Windows tells me

LINK : fatal error LNK1104: cannot open file 'libboost_thread-vc100-mt-s-1_47.lib'

This doesnt seem right to me since AFAIK I didnt add a library requirement to my project. Why does it want me to add that and how does boost do it without changing my project settings?

Or am I mistaken after all...

Any Idea?

2

2 Answers

2
votes

Adding BOOST_ALL_NO_LIB to your pre-processor definitions will keep boost packages from "auto-linking" on Windows.

1
votes

Boost uses #pragma comment(lib, library_name) to tell the compiler to link with specific libraries. If you don't want to use the code in a library with that name, you'll probably need to find the #pragma and delete (or change) it. Alternatively, you could use the nodefaultlib option with the linker.

Another way would be to use bcp to extract the part(s) of Boost you want, then build and use the libraries it creates.