我下载了Boost库,现在我只想构建一些库.什么是正确的命令?显然,内置类型=完整选项给了我太多.我正在使用Windows XP,并希望使用Bjam编译Boost和MinGW以最终使用它.目前我认为我需要库Boost.filesystem,Boost.ProgramOptions和Boost.System.另一个问题:我在哪里放置仅限标头的库?
Sam*_*ler 62
./b2 --with-program_options --with-filesystem --with-system
Run Code Online (Sandbox Code Playgroud)
或者,用于./b2 --show-libraries查看不是标题的所有库的列表.
以下是该页面的摘录:
特别是,为了限制建设所花费的时间,您可能会对以下内容感兴趣:
- 使用查看库名称列表
--show-libraries- 限制使用
--with-<library-name>或--without-<library-name>选项构建哪些库- 通过向命令行添加发布或调试来选择特定的构建变体.
注意: b2命令取决于boost版本,因此请根据您的boost版本使用以下命令(此外,在这种情况下使用--with-libraries=<comma-seperated-library-names>版本而不是--with-<library-name>):
./configure为了1.38.0和更早 ./bootstrap.sh对于1.39.0起直到1.46.0Coo*_*kie 13
这些答案对我不起作用.在Windows上,这对我有用:
b2.exe -with-LIBRARY
Run Code Online (Sandbox Code Playgroud)
例如,
b2.exe -with-test
Run Code Online (Sandbox Code Playgroud)
小智 7
该BCP实用程序是用于提取的Boost子集的工具.它对于希望与Boost分开分发库的Boost作者以及希望将Boost子集与其应用程序一起分发的Boost用户非常有用.
当前版本的Boost(1.50.0)使用Boost.Build.构建BCP的新工作流程如下:
从根Boost目录中,键入:
bootstrap.bat
Run Code Online (Sandbox Code Playgroud)
然后,一旦构建了Boost.Build,键入:
b2 tools/bcp
Run Code Online (Sandbox Code Playgroud)
例如interprocess,要提取,您可以使用:
$ mkdir /tmp/interprocess #bcp needs this
$ bcp interprocess /tmp/interprocess
Run Code Online (Sandbox Code Playgroud)
这会将进程间及其依赖项复制到/tmp/interprocess.
我有同样的问题.但我发现了一种创建必要文件的方法.
要遵循的步骤:
首先输入代码:
bootstrap.bat
Run Code Online (Sandbox Code Playgroud)然后输入以下代码以生成lib文件:
b2.exe link=static runtime-link=static --with-chrono --with-date_time --with-filesystem --with-program_options --with-system --toolset=msvc-10.0 define=BOOST_USE_WINAPI_VERSION=0x0500
Run Code Online (Sandbox Code Playgroud)库文件将在stage文件夹中创建.
| 归档时间: |
|
| 查看次数: |
38873 次 |
| 最近记录: |