Linker error LNK1104 with #39;libboost_filesystem-vc100-mt-s-1_49.lib#39;(链接器错误 LNK1104 与“libboost_filesystem-vc100-mt-s-1_49.lib)
问题描述
在发布模式下将我的程序链接到 boost::filesystem 模块的过程中,我收到下一个错误:
During the process of linking my program to the boost::filesystem module in release mode I get the next error:
错误 LNK1104:无法打开文件'libboost_filesystem-vc100-mt-s-1_49.lib'
error LNK1104: cannot open file 'libboost_filesystem-vc100-mt-s-1_49.lib'
但是,在 booststagelib 目录中,我只有下一个引用文件系统模块的库:
However, in the booststagelib directory I only have the next libraries referred to filesystem module:
libboost_filesystem-vc100-mt-1_49.lib
libboost_filesystem-vc100-mt-1_49.lib
libboost_filesystem-vc100-mt-gd-1_49.lib
libboost_filesystem-vc100-mt-gd-1_49.lib
我的问题是:
为什么 VC++ 要求'libboost_filesystem-vc100-mt-s-1_49.lib?
Why does the VC++ is asking for 'libboost_filesystem-vc100-mt-s-1_49.lib?
我应该更改哪些编译器/链接属性以使编译器要求 libboost_filesystem-vc100-mt-1_49.lib?
Which compiler/linking properties should I change to get the compiler to ask for libboost_filesystem-vc100-mt-1_49.lib?
更新:我的 VC2010++ 解决方案有 2 个项目,其中包括以前的 boost 库:x 是一个库,y(主程序)调用 x.
- 当我使用 Configuration type=Static library 和 RuntimeLibrary=Multi-threaded (/MT) 构建 x 时,没问题.
- 当我使用 Configuration type=Application (.exe) 和 RuntimeLibrary=Multi-threaded (/MT) 构建 y 时,它会发出我指出的错误,如果我更改为 Configuration type=Static 库,它构建正常,但我的主程序有 .lib 扩展名,而不是预期的 .exe.
推荐答案
您在C/C++/Code Generation/Runtime Library中使用/MT或/MTd选项需要静态库,boost默认使用共享库输出构建.您可以将 Runtime Library 切换到/MD 或/MDd.另一个选项是使用静态库输出重新编译 boost,您将获得libboost_filesystem-vc100-mt-s-1_49.lib"..
You are using /MT or /MTd option in C/C++/Code Generation/Runtime Library which require static library, boost default build with shared library output. You can switch Runtime Library to /MD or /MDd. An other option is recompile boost with static library output and you'll get 'libboost_filesystem-vc100-mt-s-1_49.lib'..
这篇关于链接器错误 LNK1104 与“libboost_filesystem-vc100-mt-s-1_49.lib"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:链接器错误 LNK1104 与“libboost_filesystem-vc100-mt-s-1_49.lib"
基础教程推荐
- 我应该对 C++ 中的成员变量和函数参数使用相同的名称吗? 2021-01-01
- CString 到 char* 2021-01-01
- GDB 显示调用堆栈上函数地址的当前编译二进制文 2022-09-05
- 非静态 const 成员,不能使用默认赋值运算符 2022-10-09
- 为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如 2022-09-16
- 通过引用传递 C++ 迭代器有什么问题? 2022-01-01
- 为什么派生模板类不能访问基模板类的标识符? 2021-01-01
- 如果我为无符号变量分配负值会发生什么? 2022-01-01
- 为什么 RegOpenKeyEx() 在 Vista 64 位上返回错误代码 2021-01-01
- 初始化列表*参数*评估顺序 2021-01-01
