Mak*_*aks 8 c++ boost linker-errors boost-build visual-studio-2013
我正在尝试使用Visual Studio 2013构建Boost 1.55.
1)我尝试使用boost-binaries(boost-binaries),但是当我尝试编译时,Visual Studio写了关于错误的信息:
错误LNK1104:无法打开文件'libboost_serialization-vc120-mt-gd-1_55.lib'.我使用了boost_1_55_0-msvc-12.0-32.exe或1.55.0-build2(boost-binaries).
我没有在boost_1_55_0\lib32-msvc-12.0目录中找到.lib文件.
2)我也尝试使用这个程序BlueGo 0.1.7(BlueGo).它工作非常顺利,并创建我需要的所有库.
问题在于它创建了像这样的.lib文件:
libboost_serialization-vc110-MT-GD-1_55.lib
但我使用Visual Studio 2013并且需要使用vc120版本的编译器而不是vc110,过度使用它会引发错误.
3)最后我决定自己创建dll/lib文件.
我在boost站点中使用了以下指南: Simplified Build From Source.
如果您希望使用Visual C++从源代码构建,可以使用本节中描述的简单构建过程.打开命令提示符并将当前目录更改为Boost根目录.然后,键入以下命令:
bootstrap
.\b2
Run Code Online (Sandbox Code Playgroud)
上面我写了,我需要做什么.
我启动了"VS2012 x86 Native Tools命令提示符",将dir更改为boost root目录并输入命令:
bootstrap
Run Code Online (Sandbox Code Playgroud)
我马上得到了错误:
C:\thirdparty\vs2013\x86\boost_1_55_0>.\bootstrap.bat
Building Boost.Build engine
Failed to build Boost.Build engine.
Please consult bootstrap.log for furter diagnostics.
You can try to obtain a prebuilt binary from
http://sf.net/project/showfiles.php?group_id=7586&package_id=72941
Also, you can file an issue at http://svn.boost.org
Please attach bootstrap.log in that case.
Run Code Online (Sandbox Code Playgroud)
在日志文件中,我注意到以下错误:
execnt.c(56):致命错误C1083:无法打开包含文件:'tlhelp32.h':没有这样的文件或目录
bootstrap.log文件:
###
### Using 'vc12' toolset.
###
C:\thirdparty\vs2013\x86\boost_1_55_0\tools\build\v2\engine>if exist bootstrap rd /S /Q bootstrap
C:\thirdparty\vs2013\x86\boost_1_55_0\tools\build\v2\engine>md bootstrap
C:\thirdparty\vs2013\x86\boost_1_55_0\tools\build\v2\engine>cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib /Febootstrap\jam0 command.c compile.c constants.c debug.c execcmd.c execnt.c filent.c frames.c function.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c object.c option.c output.c parse.c pathnt.c pathsys.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c md5.c class.c cwd.c w32_getreg.c native.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c
command.c
compile.c
constants.c
debug.c
execcmd.c
execnt.c
execnt.c(56) : fatal error C1083: Cannot open include file: 'tlhelp32.h': No such file or directory
filent.c
frames.c
function.c
glob.c
hash.c
hdrmacro.c
headers.c
jam.c
jambase.c
jamgram.c
lists.c
make.c
make1.c
object.c
Generating Code...
Compiling...
option.c
output.c
parse.c
pathnt.c
pathsys.c
regexp.c
rules.c
scan.c
search.c
subst.c
timestamp.c
variable.c
modules.c
strings.c
filesys.c
builtins.c
md5.c
class.c
cwd.c
w32_getreg.c
Generating Code...
Compiling...
native.c
set.c
path.c
regex.c
property-set.c
sequence.c
order.c
Generating Code...
Run Code Online (Sandbox Code Playgroud)
我试着检查是否存在这个文件('tlhelp32.h').我创建了一个项目并包含文件('tlhelp32.h').编译没有任何错误.
4)我也尝试重命名
libboost_serialization-vc110-MT-GD-1_55.lib
至
libboost_serialization-VC120-MT-GD-1_55.lib
但Visual Studio再次抛出错误.
Error 1 error LNK1104: cannot open file 'libboost_serialization-vc120-mt-gd-1_55.lib'.
Run Code Online (Sandbox Code Playgroud)
你能告诉我是什么问题以及如何使用Visual Studio 2013构建Boost 1.55?
提前致谢!
让我们一步一步来,首先构建 boost 构建系统。
“我包含该文件('tlhelp32.h')。它编译后没有任何错误。”
因此,该文件存在于磁盘上。由 bootstrap.bat 运行的 cl.exe 的环境变量设置不同。cl.exe 在INCLUDE环境变量中搜索包含文件。在磁盘上找到 tlhelp32.h,并在 Visual Studio 命令提示符中将此路径添加到 INCLUDE:
set INCLUDE=%INCLUDE%;<path to tlhelp32.h>
Run Code Online (Sandbox Code Playgroud)
如果找不到某些 .lib,请查看LIBPATH环境变量。
我想 VS2013 vcvars*.bat 文件没有正确设置环境。
| 归档时间: |
|
| 查看次数: |
9567 次 |
| 最近记录: |