简体   繁体   中英

How to integrate boost thread(source files) into my own project

What I want is to put the source files about the boost thread(all necessary header and source files) into my own project so that other people don't need to configure the support of boost anymore. The build system is made by CMake.

Recently I am trying to update the boost thread to the actual version 1.53, but the new version of boost thread cannot get built in windows.(it works under linux)

What I do to integrate the boost thread is very simple, I just put all source files required by boost::thread in one folder (including the source files of boost::system) and make a DLL for all these source files. (with build option BOOST_THREAD_BUILD_DLL)

But when the built dll library above is linked to my own code, I got some unresolved reference errors to the boost::system like:

"unresolved reference to error_category xxxx"

But the built library contains the source files from the boost::system, I have no idea why such error comes. Could you guys give me some hints? thanks a lot, I have already spent quite time about this disgusting probem :(

As Johannes pointed out in his comment, the BCP tool is designed to do exactly this:

The bcp utility is a tool for extracting subsets of Boost, it's useful for Boost authors who want to distribute their library separately from Boost, and for Boost users who want to distribute a subset of Boost with their application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM