错误LNK1104无法打开文件'libboost_filesystem-vc141-mt-gd-1_65_1.lib'

时间:2017-10-25 23:57:16

标签: c++ boost compiler-errors boost-filesystem

我似乎无法解决这个问题。我想使用boost但继续得到错误LNK1104无法打开文件'libboost_filesystem-vs141-mt-gd-1_65_1.lib'。我遵循了以下步骤: 1.运行蝙蝠 2.运行b2(最初是bjam) 3.链接文件。 收到错误后,我做了挖掘,并改变了一些其他的东西。请参阅下面的图片,以便更好地了解我已完成的工作This is the VC++ where I added the boost_pathThis is the linker

我感谢将来的所有答案,并感谢您抽出宝贵的时间。

4 个答案:

答案 0 :(得分:1)

确保在项目的Visual Studio调试属性中,将“ \ stage \ lib”添加到链接程序库的include路径。如果通过先运行bootstap.bat批处理文件,然后运行b2.exe来通过命令提示符安装boost,则在编译过程完成时,将显示一条消息,指示您添加该路径,因此链接器不会混淆当它寻找它时。

答案 1 :(得分:0)

the most common causes of this error are:

1- Architecture. The .lib is x64 and the build is 32 bits or viceversa (.libs are 32 and build is x64).

2- Path to the files. Check the boost path is the same. If you are using the precompiled libraries the path is similar to .....\boost_1_65_1\lib64-msvc-14.1 But if you have compiled, it will be like stage\lib. Search for it in the explorer and cut and paste the path.

Regards

答案 2 :(得分:0)

使用 boost_1_67_0-msvc-14.0-64.exe (从https://sourceforge.net/projects/boost/files/boost-binaries/1.67.0/下载)安装预构建增强后,我遇到了类似的错误。事实证明pre-build(14.0)有lib命名问题,比如引用名称中包含字符串“-vc141-”的文件而不是“-vc140 - ”。

我放弃了它并使用了安装程序 boost_1_67_0-msvc-14.1-64.exe (请注意msvc14.1)。我看到的所有问题现在都消失了。

由于

KB

答案 3 :(得分:0)

这是因为配置的平台工具集与您要使用的库不同。 您可以在Visual Studio '19中的以下设置下轻松进行设置:配置属性->常规->平台工具集,然后选择要使用的工具集。

例如: PlatformToolset