在 Visual C 中使用 boost 1_47快报2010

发布于 2024-12-03 08:40:47 字数 345 浏览 1 评论 0原文

我已经安装并构建(据我所知是成功的),boost 1_47_0。我现在正在尝试获取示例程序(正则表达式)及其安装指南来运行,它给了我以下链接错误:

LNK2019:无法解析的外部符号“private:class boost :: basic_regex ....

我怀疑问题是这些库是使用 b2 构建为 vc100 的,平台工具集是 Windows7.1SDK,我无法将平台工具集更改为 v100,否则会生成 kernel32.lib 丢失错误。似乎无法弄清楚如何构建 boost,以便它是 sdk7。我正在使用 Visual C++ Express 2010,并且还尝试过从 Windows7.1SDK 命令行提示符构建

I have installed and built (successfully as far as I can tell), boost 1_47_0. I am now trying to get the sample program (the regex one) with their install guide to run and it is giving me the following link error:

LNK2019: unresolved external symbol "private: class boost::basic_regex ....

I suspect that the problem is that the libraries were built as vc100 using b2 and the Platform Toolset is Windows7.1SDK. I cannot change the Platform Toolset to v100 or it generates a kernel32.lib missing error. And I cannot seem to figure out how to build boost so that it is sdk7. I am using Visual C++ Express 2010 and have also tried building from the Windows7.1SDK command line prompt.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

暮年慕年 2024-12-10 08:40:47

当我使用“BoostPro Computer”中的安装程序安装 boost 时,我遇到了同样的问题。我通过从源代码编译 boost lib 来解决这个问题。
步骤如下:

  1. 输入 Visual Studio 2010 Express 命令提示符
  2. cd 到解压后的 boost 目录
  3. bootstrap.bat
  4. .\b2

完成。

这是我的环境:

  • Win7 64位
  • Visual Studio 2010 Express
  • boost 1_52_0

I meet the same issue when I install boost with installer from "BoostPro Computing". And I solve it by compiling boost lib from source code.
Here is the steps:

  1. enter Visual Studio 2010 Express Command Prompt
  2. cd to the unzipped boost dir
  3. bootstrap.bat
  4. .\b2

Done.

Here is my environment:

  • Win7 64bit
  • Visual Studio 2010 Express
  • boost 1_52_0
偏闹i 2024-12-10 08:40:47

我使用调用 bjam 的批处理文件构建 boost,并且在项目中使用正则表达式库没有遇到任何问题。我使用的是VS2010专业版。以下是我的批处理文件中的几行,额外的库位置对您来说可能并不重要,我只是将它们放在这里是为了完整性:

call "C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat"
SET ZLIB_SOURCE=%LIBS%\zlib
SET ZLIB_INCLUDE=%LIBS%\zlib
SET BZIP2_SOURCE=%LIBS%\bzip2-1.0.5
SET BZIP2_INCLUDE=%LIBS%\bzip2-1.0.5
SET BZIP2_BINARY=libbz2
SET ZLIB_BINARY=zdll
SET EXPAT_INCLUDE=%LIBS%\Expat\Source\lib
SET EXPAT_LIBPATH=%LIBS%\Expat\Bin
SET EXPAT_BIN=%LIBS%\Expat\Bin

bjam.exe  --disable-filesystem2 --build-type=complete --user-config=%UTILS%\user-config.jam 

当然,您的库和 user-config.jam 的路径会有所不同,并且user-config.jam 中只有一行非常重要:

using msvc : 10.0 ;

成功构建后,您需要将 stage/lib 目录的路径添加到项目的其他库设置中,以便链接器满意。此外,由于这是一个快速构建,您可能需要修改包含路径才能获取平台 SDK。我从顶级 Boost 目录运行这个批处理文件。

I build boost using a batch file that calls bjam, and I have not had any problems using the regex library in my projects. I am using VS2010 Pro. Here are the lines from my batch file, the extra library locations might not be important to you, I'm just putting them here for completeness:

call "C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat"
SET ZLIB_SOURCE=%LIBS%\zlib
SET ZLIB_INCLUDE=%LIBS%\zlib
SET BZIP2_SOURCE=%LIBS%\bzip2-1.0.5
SET BZIP2_INCLUDE=%LIBS%\bzip2-1.0.5
SET BZIP2_BINARY=libbz2
SET ZLIB_BINARY=zdll
SET EXPAT_INCLUDE=%LIBS%\Expat\Source\lib
SET EXPAT_LIBPATH=%LIBS%\Expat\Bin
SET EXPAT_BIN=%LIBS%\Expat\Bin

bjam.exe  --disable-filesystem2 --build-type=complete --user-config=%UTILS%\user-config.jam 

Of course the path to your libraries and your user-config.jam will be different, and the only one line in user-config.jam that is really important is:

using msvc : 10.0 ;

After a successful build you will want to add the path to the stage/lib directory to you additional libraries settings for the project so the linker is satisfied. Also since this is an express build you may have to fiddle with the include path to pick up the platform SDK. I run this batch file from the top level Boost directory.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文