链接器错误 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'..
相关文章