构建 Boost BCP [英] Building Boost BCP

查看:24
本文介绍了构建 Boost BCP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

过去两个小时我一直在尝试构建 Boost C++ 库,但停止了没有任何结果.由于我是 C++ 的新手,因此无法正确构建.如何使用 Visual Studio 2008 正确构建它?

I was trying to build Boost C++ Libraries for last two hours and stopped without any result. Since I am new to C++, I am unable to get the build right. How can I build it correctly using Visual Studio 2008?

我需要使用 BCP 工具来提取库的子集.所以我需要先建立BCP,对吗?这个怎么做?当我尝试构建它时,出现以下错误

I need to use the BCP tool to extract a subset of library. So I need to build BCP first, right? How to do this? When I tried to build it, I got the following error

致命错误 LNK1104:无法打开文件libboost_filesystem-vc90-mt-gd-1_37.lib".

哪里可以得到上面给定的库文件?

Where can I get the above given library file?

推荐答案

首先,您需要在命令 shell 中拥有正确的 PATH、INCLUDE 和 LIB 环境变量.为此,使用参数调用文件vcvarsall.bat"(或类似的):

First, you need to have the proper PATH, INCLUDE and LIB environment variables in your command shell. For this, call the file "vcvarsall.bat" (or similar) with parameter:

vcvarsall.bat x86

接下来你必须构建 bjam(你也可以从 Boost 页面下载它,但它几乎一样快).转到 Boost 中的 toolsjamsrc 文件夹并输入:

Next you have to build bjam (you can also download it from the Boost page, but it's almost as quick). Go to the toolsjamsrc folder in Boost and type:

build.bat

它应该生成一个包含 bjam.exe 的子文件夹 bin.ntx86.为方便起见,将其复制到 Boost 主文件夹.接下来,您可以构建 bcp.进入 toolscp 文件夹并输入:

It should produce a subfolder bin.ntx86 that contains bjam.exe. For convenience, copy it to the Boost main folder. Next, you can build bcp. Go into the toolscp folder and type:

....jam.exe --toolset=msvc

回到 Boost 主文件夹,您可以构建您想要的任何库:

Back in the Boost main folder you can then build any library you wish:

bjam toolset=msvc –-with-{library}

其中 {library} 是要构建的库之一.所有可构建的库都可以显示为:

where {library} is one of the libraries to build. All buildable libraries can be shown with:

bjam –-show-libraries

还有更多的 bjam 构建参数.您可以指定带有关键字的一些参数是:

There are many more bjam build parameters. Some parameters with keywords you can specify are:

variant=debug|release
link=shared|static
threading=multi|single

一个例子是:

bjam toolset=msvc –-with-filesystem threading=multi variant=debug stage

有关更多信息,请访问 Boost 文档页面.

For more infos, visit the Boost documentation pages.

更新了指向最新 Boost 文档的链接

Updated link to point to most recent Boost documentation

更正选项 --with-{library} 和 --show-libraries

Corrected options --with-{library} and –-show-libraries

这篇关于构建 Boost BCP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆