Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29274 Discussions

Link error LNK2019 with static use of fortran lib libirc.lib

lin123go
Beginner
574 Views
Hi all,
i have a c++ project wich accesses some Fortran *.a file through fortran Libraries.
I create the .exe in with 2 commandlines in cmd.exe:

(1) CL /MD /c test.cpp
(2) LINK /LIBPATH:"C:\Programme\Intel\Compiler\11.1\048\lib\ia32"/out:test.exe test.obj ds_md.a

This works well. The problem is that the createt application is dynamically linked to msvcrt.lib and runs only maschines with msvcrt.lib.
When i link statically to libcmt.lib using /MT in (1) and ds_mt.a in (2),i get following linking errors: (Sorry for my German)

libirc.lib(tbk_backtrace.obj) : error LNK2019: Verweis auf nicht aufgelstes externes Symbol "__imp__SymInitialize@12" in Funktion "_tbk_trace_stack".
libirc.lib(tbk_backtrace.obj) : error LNK2019: Verweis auf nicht aufgelstes externes Symbol "__imp__SymCleanup@4" in Funktion "_tbk_trace_stack".
libirc.lib(tbk_backtrace.obj) : error LNK2019: Verweis auf nicht aufgelstes externes Symbol "__imp__StackWalk@36" in Funktion "_tbk_trace_stack".
test.exe : fatal error LNK1120: 3 nicht aufgelste externe Verweise.

Any idea how to proceed?

I allready tried /Oi-
I also tried to ignore the libraries :libc.lib, msvcrt.lib, libcd.lib, libcmtd.lib, msvcrtd.lib
Then i tried to use libircmt.lib instead of libirc.lib. (same errors with libircmt.lib)
These options had no effects.

I am using visual studio 2005 and intel fortran compiler 11.1 on windows 32 bits.
Thanks for your Help.
0 Kudos
1 Reply
lin123go
Beginner
574 Views
Quoting - lin123go
Hi all,
i have a c++ project wich accesses some Fortran *.a file through fortran Libraries.
I create the .exe in with 2 commandlines in cmd.exe:

(1) CL /MD /c test.cpp
(2) LINK /LIBPATH:"C:ProgrammeIntelCompiler11.1�48libia32"/out:test.exe test.obj ds_md.a

This works well. The problem is that the createt application is dynamically linked to msvcrt.lib and runs only maschines with msvcrt.lib.
When i link statically to libcmt.lib using /MT in (1) and ds_mt.a in (2),i get following linking errors: (Sorry for my German)

libirc.lib(tbk_backtrace.obj) : error LNK2019: Verweis auf nicht aufgelstes externes Symbol "__imp__SymInitialize@12" in Funktion "_tbk_trace_stack".
libirc.lib(tbk_backtrace.obj) : error LNK2019: Verweis auf nicht aufgelstes externes Symbol "__imp__SymCleanup@4" in Funktion "_tbk_trace_stack".
libirc.lib(tbk_backtrace.obj) : error LNK2019: Verweis auf nicht aufgelstes externes Symbol "__imp__StackWalk@36" in Funktion "_tbk_trace_stack".
test.exe : fatal error LNK1120: 3 nicht aufgelste externe Verweise.

Any idea how to proceed?

I allready tried /Oi-
I also tried to ignore the libraries :libc.lib, msvcrt.lib, libcd.lib, libcmtd.lib, msvcrtd.lib
Then i tried to use libircmt.lib instead of libirc.lib. (same errors with libircmt.lib)
These options had no effects.

I am using visual studio 2005 and intel fortran compiler 11.1 on windows 32 bits.
Thanks for your Help.

I Installed Windows Platform SDK and used dbghelp.lib
now it works!
0 Kudos
Reply