2

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?

4

2 回答 2

1

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

  1. 进入 Visual Studio 2010 Express 命令提示符
  2. cd 到解压后的 boost 目录
  3. 引导程序.bat
  4. .\b2

完毕。

这是我的环境:

  • Win7 64位
  • Visual Studio 2010 速成版
  • 提升 1_52_0
于 2013-01-10T15:41:32.997 回答
0

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

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 目录运行这个批处理文件。

于 2011-09-06T17:38:27.380 回答