首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >错误LNK2001:从IVF调用IMSL时无法解析外部符号?

错误LNK2001:从IVF调用IMSL时无法解析外部符号?
EN

Stack Overflow用户
提问于 2016-09-09 09:40:05
回答 1查看 1K关注 0票数 0

当我用IVF+IMSL编译和链接我的源代码时,我得到了一系列的错误。看起来像是

代码语言:javascript
复制
>main.f90
    1>Linking...
    1>msvcrt.lib(MSVCR120.dll) : error LNK2005: __time32 has already defined in LIBCMT.lib(time.obj) 
    1>imsls_err.lib(e1ucs.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
    1>imsls_err.lib(e1inpl.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
    1>imsls_err.lib(flexlm.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
    1>imsls_err.lib(e1lock.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
    1>imsls_err.lib(e1init.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
    1>imsls_err.lib(e2psh_lmf.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
    1>imsls_err.lib(e1prt.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
    1>imsls_err.lib(n1rgb.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
    1>imsls_err.lib(e1mes.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
    1>imsls_err.lib(e1std.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
    1>imsls_err.lib(e1sti.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
    1>imsls_err.lib(e1stl.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
    1>imsl.lib(dr1ins.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
    1>imsls_err.lib(e1psh_lmf.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
    1>imsls_err.lib(n1rty.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
    1>imsls_err.lib(e1pop.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
    1>imsl.lib(dr1t64.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
    1>imsl.lib(r1in32.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
    1>imsl.lib(dr1t32.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
    1>imsl.lib(r1inf.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
    1>imsl.lib(rnset.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
    1>imsl.lib(drnun.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
    1>imsl.lib(r1int.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
    1>imsl.lib(r1in64.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
    1>imsls_err.lib(e1inpl.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
    1>imsls_err.lib(e1init.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
    1>imsls_err.lib(e1prt.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
    1>imsls_err.lib(n1rgb.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
    1>imsls_err.lib(e1ucs.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
    1>imsls_err.lib(e1mes.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
    1>imsls_err.lib(e1std.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
    1>imsls_err.lib(e1sti.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
    1>imsls_err.lib(e1stl.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
    1>imsl.lib(dr1ins.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
    1>imsls_err.lib(e1psh_lmf.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
    1>imsls_err.lib(n1rty.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
    1>imsls_err.lib(e1pop.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
    1>imsl.lib(dr1t64.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
    1>imsl.lib(r1in32.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
    1>imsl.lib(dr1t32.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
    1>imsl.lib(r1inf.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
    1>imsl.lib(rnset.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
    1>imsl.lib(drnun.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
    1>imsl.lib(r1int.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
    1>imsl.lib(r1in64.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached

我猜错误的一个可能来源是我的源代码来自其他作者,并且是几年前(大约2004年)编写的。因此,我的IMSL版本(7.0)可能与他的不同。在原始代码中,它使用类似INCLUDE 'link_f90_static.h'的命令调用IMSL,但使用Error #5102: cannot open link_f90_static.h调用失败。或者,我将此命令替换为

代码语言:javascript
复制
  include link_fnl_static.h

并解决了错误#5102。但是出现了LNK2019错误的一个分支。我不知道这是否真的是由IMSL版本问题引起的。英特尔fortran用户论坛中类似的帖子是https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/298641,但由于我从未安装过CVF,它可能不是我问题的根源。

有什么建议吗?谢谢。

EN

回答 1

Stack Overflow用户

发布于 2016-09-10 00:21:35

正如英特尔提供的IMSL指令所说,如果要链接到IMSL的静态库形式,还需要链接到OpenMP库。其中一种方法是添加以下行:

!DEC$ OBJCOMMENT LIB:"libiomp5md.lib“

在包含行之后。

但我的首选是让您包含“link_fnl_shared.h”。这可能也会处理那个__time32引用。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39402568

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档