当我用IVF+IMSL编译和链接我的源代码时,我得到了一系列的错误。看起来像是
>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调用失败。或者,我将此命令替换为
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,它可能不是我问题的根源。
有什么建议吗?谢谢。
发布于 2016-09-10 00:21:35
正如英特尔提供的IMSL指令所说,如果要链接到IMSL的静态库形式,还需要链接到OpenMP库。其中一种方法是添加以下行:
!DEC$ OBJCOMMENT LIB:"libiomp5md.lib“
在包含行之后。
但我的首选是让您包含“link_fnl_shared.h”。这可能也会处理那个__time32引用。
https://stackoverflow.com/questions/39402568
复制相似问题