无法使用VS2012链接到静态升压库,而动态链接工作正常
Unable to link to static boost library using VS2012 while dynamic linking works fine
我正在尝试使用 VS2012 Express 将 boost 库(boost/thread.hpp 和 boost/asio.hpp(静态链接到我的项目。生成目标设置为具有选项多线程 (/MT((静态链接(的 Windows XP (v110_xp(。提升库的路径在我的项目属性中设置正确。(C:\Boost\boost_1_54_0\stage\lib(尽管如此,我还是收到以下链接器错误:
error LNK1104: file "libboost_system-vc110-mt-s-1_54.lib" cannot be opened.
我的库文件夹中确实缺少此文件。但是,当使用多线程 DLL (/MD( 选项动态链接时,所有链接都正常。我最初使用简单的构建方法构建 boost 库,如下所述:http://www.boost.org/doc/libs/1_54_0/more/getting_started/windows.html#simplified-build-from-source
bootstrap
.b2
由于静态库明显丢失,我调用:
b2 --link=static
如下所述: http://www.boost.org/boost-build2/doc/html/bbv2/tutorial/linkage.html
这执行没有错误,但似乎没有构建任何新的东西。我错过了什么?还是VS正在寻找一个永远不存在的文件?我很惊讶,当我在谷歌上搜索错误时,只得到了一把点击,但没有一个真正有帮助。
使用以下
参数调用b2
:
link=static runtime-link=static
请注意,link
和 runtime-link
之前没有连字符。
相关文章:
- g++用户定义的动态链接库上的全局new和delete运算符
- 如何使用C++导出制作动态链接库
- 链接 c++ 动态库一直失败
- 如果包含映射的静态库与可执行文件和动态库链接,静态映射(变量)是否会被多次释放?
- 使用动态链接加载程序 <dlfcn.h> 而不是直接函数调用的目的是什么?
- 动态链接库中C++回调函数
- 如果同时存在共享库和动态库,则链接器将首选哪个库?
- 我的动态链接队列在同一输出流中调用时不正确地输出三个返回函数
- 如何动态链接 grpc 库 c++?
- 如何在Windows上链接动态构建的cmake文件
- 当我链接动态库而不是静态库时,CMake 有效
- 在MacOS上使用Bazel链接动态库
- 链接动态库
- 链接动态和静态库 RCPP
- Windows C++Eclipse MinGW链接动态和静态库
- 如何根据另一个动态库链接动态库
- 从另一个 dll 链接动态 dll 会导致错误
- 链接动态库时出错.所以使用Lua
- G++:链接动态(dylib)库
- Qt - 帮助链接动态库