Linker-> Input中不存在的库的链接错误

时间:2015-11-05 09:20:17

标签: boost visual-studio-2013 linker-errors caffe icc

我正在将Berkley的Caffe编译为静态库,MT,MSVC 12(VS2013)并将其链接到dll。 它工作正常 现在我尝试使用英特尔C ++ 2015编译器进行编译 - 静态库构建正常,但依赖的dll因以下链接器错误而失败:

  

致命错误LNK1104:无法打开文件   ' libboost_thread-IW-MT-S-1_58.lib'

我的Boost构建中确实没有这样的库,但我不知道这种依赖来自哪里。除了编译器我没有改变任何其他设置,我无法在我的dll的链接器>输入 - >附加依赖项的Caffe中找到Boost lib。
我该如何解决这个问题? 谢谢!

1 个答案:

答案 0 :(得分:1)

在此处找到解决方案:https://software.intel.com/en-us/articles/intel-c-compiler-for-windows-fatal-link-error-lnk1104-when-using-intel-c-compiler-with-boost-libraries

复制:

  

构建使用Boost库的应用程序时   英特尔®C++编译器,您可能会收到链接器错误,如显示的那样   由于错误的库链接到应用程序,因此

     

致命错误LNK1104:无法打开文件   'libboost_thread-iw-mt-1_33_1.lib'致命错误LNK1104:无法打开   文件'libboost_thread-iw-1_33_1.lib'...缺少根本原因   为英特尔®C++编译器提升库。

     

首选解决方案是重新编译所有必需的Boost库   使用英特尔®C++编译器(带有中缀“iw”的库是   因此而创造)。但是,这不是强制性的。该   为不同的Microsoft Visual Studio *版本提供的库   使用也很安全。执行以下步骤以使用它们   代替:

     

打开Boost配置文件“auto_link.hpp”。搜索1

     

elif定义(__ ICL)2 3 4

                       // Intel C++, no version number: 5   6
                    #  define BOOST_LIB_TOOLSET "iw" Change "iw" depending on which Microsoft Visual Studio version you're using:
     

“vc71”:Microsoft Visual Studio .NET 2003“vc80”:Microsoft Visual   Studio 2005“vc90”:Microsoft Visual Studio 2008“vc100”:Microsoft   Visual Studio 2010“vc110”:Microsoft Visual Studio 2012“vc120”:   Microsoft Visual Studio 2013“vc140”:Microsoft Visual Studio 2015

     

重建您的应用程序以解决链接器错误。