致命错误 LNK1104:无法打开文件“libboost_log-vc141-mt-gd-1_64.lib"

我正在编写一个利用 Boost 日志记录功能的程序,因此,在尝试构建上述程序时,我在生成代码时遇到以下错误(在 Visual Studio 2017 上):

I'm writing a program which utilizes Boost logging features and consequently, when attempting to build the said program, I'm getting the following error when generating code (on Visual Studio 2017):

1>链接:致命错误 LNK1104:无法打开文件libboost_log-vc141-mt-gd-1_64.lib"

1>LINK : fatal error LNK1104: cannot open file 'libboost_log-vc141-mt-gd-1_64.lib'

不过,我可以确认以下几点:

However, I can confirm the following:

  • boost_1_64_0stagelib 已添加到 Linker -> General 下的Additional Library Directories"中
  • libboost_log-vc141-mt-gd-1_64.lib 位于 stage/lib 下,因为在解压 Boost 时,我使用工具集设置为 14.1 进行了完整构建
  • 根据相关问题的答案,我确实将特定的 .lib 添加到 Linker -> Input 下的Additional Dependencies"中

我觉得很明显我错过了一些东西.但是,任何帮助将不胜感激.

I feel like it's something obvious that I am missing. But, any help would be much appreciated.

推荐答案

drescherjm 是正确的,我混合了 32 和64 位.需要将 Project Configuration Properties -> Linker -> Advanced 下的 Target Machine 更改为 MACHINEX86 并且它起作用了.

drescherjm was correct, I was mixing 32 and 64 bit. Needed to change Target Machine under Project Configuration Properties -> Linker -> Advanced to MACHINEX86 and it worked.

谢谢!

相关文章