【问题标题】:link error for library which doesn't exist in Linker->Input链接器->输入中不存在的库的链接错误
【发布时间】:2016-02-06 01:22:18
【问题描述】:

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

致命错误 LNK1104:无法打开文件 'libboost_thread-iw-mt-s-1_58.lib'

在我的 Boost 构建中确实没有这样的库,但我不知道这种依赖来自哪里。除了编译器,我没有更改任何其他设置,并且在我的 dll 的 Linker->Input->Additional dependencies 的任一 Caffe 中都找不到 Boost lib。
我该如何解决这个问题?
谢谢!

【问题讨论】:

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


    【解决方案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 库。

    首选的解决方案是重新编译所有必需的 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”:微软 Visual Studio 2008“vc100”:微软 Visual Studio 2010“vc110”:Microsoft Visual Studio 2012“vc120”: Microsoft Visual Studio 2013“vc140”:Microsoft Visual Studio 2015

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-11
      • 1970-01-01
      • 2020-02-02
      • 1970-01-01
      相关资源
      最近更新 更多