简体   繁体   English

如何将boost线程(源文件)集成到我自己的项目中

[英]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. 我想要的是将关于boost线程的源文件(所有必需的头文件和源文件)放入我自己的项目中,以便其他人不再需要配置boost的支持。 The build system is made by CMake. 构建系统由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) 最近我试图将boost线程更新到实际版本1.53,但新版本的boost线程无法在windows中构建。(它在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. 我整合boost线程的工作非常简单,我只需将boost :: thread所需的所有源文件放在一个文件夹中(包括boost :: system的源文件),并为所有这些源文件制作一个DLL。 (with build option BOOST_THREAD_BUILD_DLL) (使用构建选项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: 但是当上面构建的dll库链接到我自己的代码时,我得到一些未解决的引用错误到boost :: system,如:

"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. 但是构建的库包含来自boost :: system的源文件,我不知道为什么会出现这样的错误。 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: 正如约翰内斯在评论中指出的那样, BCP工具的目的是做到这一点:

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. bcp实用程序是一个用于提取Boost子集的工具,它对于希望与Boost分开分发其库的Boost作者以及希望将Boost子集与其应用程序一起分发的Boost用户非常有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何为我的项目添加提升? - How to add boost to my project? 我无法在自己的标头中包含boost标头文件 - I can't include boost header files in my own header 如何将Boost集成到Visual C ++项目中? - How do I integrate Boost into a Visual C++ project? 如何使用我从源代码构建的库而没有错误,但不能为我自己的项目编译? - How can I use the library that I have built without error from source, but not compiling for my own project? Boost :: Thread库是否应该与/ MD生成的项目一起部署? - Shouldn't Boost::Thread libraries be deployed with my project generated with /MD? 如何将Boost.uuid集成到我的跨平台代码中? - How to integrate Boost.uuid into my cross-platform code? 使用我自己的源目录生成vs2010项目文件 - generate vs2010 project file with my own source directories Boost::thread 如何获取指向调用我的 function 的线程的指针? - Boost::thread how to get a pointer to the thread where my function is called? 如何将用C编写的源代码从另一个项目包含到我自己的Visual Studio C ++项目中 - How can I include source code written in C from another project into my own project in C++ in Visual Studio 如何在我自己的头文件中不包含boost头文件 - how to not include boost header file in my own header file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM