简体   繁体   中英

C++ Boost thread library pulls in the whole development environment

I am using boost-thread in my application. When I deploy this application on a client machine (running Ubuntu 11.10), I need to make sure that libboost_thread.so is available on the machine. However, when I run "apt-get install libboost-thread1.46," it seems to pull in the whole development enviornment (libgcc, libbost1.46-dev, etc.). This machine needs just the runtime environment, not the development environment. I am wondering if there is a better way to handle this.

No such package exception: The package "libboost-thread1.46" does not exist on Ubuntu, is treated by apt-get as a regular expression, and the development package also matches the expression. The two candidate packages are named libboost-thread1.46-dev and libboost-thread1.46.1 , where the latter is the package you want. It depends only on three libraries (libgcc, libc, libstdc++), all of which you need to deploy anyway because your program and libboost-thread link against them.

So, deploy by installing libboost-thread1.46.1 and everything should be fine.

您可以通过下载boost tar并使用bjam构建工具来构建自己的需求。

您可以静态链接反对升压。

You can also use bcp and copy the necessary files into your own source tree. I personally have the headers installed on my system and just added the source files to my project ( once.cpp , thread.cpp , timeconv.inl , tss_null.cpp on Linux).

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