0

当我使用 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)可能与他的不同。在原始代码中,它使用类似命令调用 IMSL INCLUDE 'link_f90_static.h',但使用Error #5102: cannot open link_f90_static.h. 或者,我将此命令替换为

  include link_fnl_static.h

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

有什么建议吗?谢谢你。

4

1 回答 1

0

As the Intel-supplied IMSL instructions say, if you are going to link to the static library form of IMSL you also need to link to the OpenMP libraries. One way to do that is to add the line:

!DEC$ OBJCOMMENT LIB:"libiomp5md.lib"

following that INCLUDE line.

But my preferred choice would be for you to include 'link_fnl_shared.h' instead. This would probably also take care of that __time32 reference.

于 2016-09-09T16:21:34.513 回答