Boost :: Thread without windows library

I would like to avoid creating a whole library just for boost::Thread

. So I added cpp files to libs / Thread for 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'

It doesn't seem right to me since AFAIK. I have not added library requirements to my project. Why does he want me to add this and how to do it without changing my project settings?

Or am I wrong in the end ...

Any idea?


source to share

2 answers

Adding BOOST_ALL_NO_LIB to your pre-processor definitions will cause speed packs to be automatically activated on Windows.



Boost uses #pragma comment(lib, library_name)

to tell the compiler to link to specific libraries. If you don't want to use code in a library with that name, you probably need to find #pragma

and remove (or change) it. Alternatively, you can use the nodefaultlib

linker option .

Another way would be to use bcp

to extract the Boost part (s) you want, and then to build and use the libraries that are generated.



All Articles