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

LNK 2019 error

rre9518
Beginner
790 Views

I am linking a static libraryIVF ver 11 project into a C++ solution in Visual Studio 2005, sp1. Getting the link error
libifcoremt.lib(for_init.obj) : error LNK2019: unresolved external symbol __argv references in function _for_rtl_init
libifcoremt.lib(for_init.obj) : error LNK2019: unresolved external symbol __argc referenced in function _for_rtl_init

The C++ project calling this library uses Multithreaded Debug DLL (MDd). This same Fortran project was linked successfully with another C++ project so I don't believe there's a problem with the project settings for the library. In the project which linked successfully, the Intel Fortran libraries used were
libifcoremdd.dll
libifportmd.dll
libmmdd.dll

My question is, what triggered the use of libifcoremt.dll instead of libifcoremdd.dll?
Why would a static library be looking for argc and argv?

0 Kudos
3 Replies
Steven_L_Intel1
Employee
790 Views
There is a problem with the settings for the Fortran project. It needs to match that of the C++ project. Your Fortran project specifies "Multithreaded" (/MT) and the C++ project is using "Multithreaded Debug DLL" (/MDd). The reason for the undefined references is because C/C++ libraries use different names for certain global symbols in static and DLL libraries.

Change the Fortran library project to use the DLL libraries. This may affect your use with other C++ projects that have different libraries specified.
0 Kudos
proud2bhaole
Beginner
790 Views
There is a problem with the settings for the Fortran project. It needs to match that of the C++ project. Your Fortran project specifies "Multithreaded" (/MT) and the C++ project is using "Multithreaded Debug DLL" (/MDd). The reason for the undefined references is because C/C++ libraries use different names for certain global symbols in static and DLL libraries.

Change the Fortran library project to use the DLL libraries. This may affect your use with other C++ projects that have different libraries specified.

Hi

I may also have the same problem. I get a bunch of LNK 2019 and LNK 2001 errors.

Do you think it might be because of this mismatched setting? (/MT vs. /MDd)?

I unfortunately do not have the source code for the libraries. Just the libraries themselves.

This is with Visual Studio Pro 2008.

Thank you,
Kevin

Here's the error codes below:
DVERK.LIB(dverk.obj) : error LNK2019: unresolved external symbol __FFsSTOP referenced in function _DVERK
LAPACK.LIB(xerbla.obj) : error LNK2001: unresolved external symbol __FFsSTOP
DVERK.LIB(dverk.obj) : error LNK2019: unresolved external symbol _f90_endwrite referenced in function _DVERK
LAPACK.LIB(xerbla.obj) : error LNK2001: unresolved external symbol _f90_endwrite
MINPACK1.LIB(d1mach.obj) : error LNK2001: unresolved external symbol _f90_endwrite
MINPACK1.LIB(i1mach.obj) : error LNK2001: unresolved external symbol _f90_endwrite
DVERK.LIB(dverk.obj) : error LNK2019: unresolved external symbol _write_d referenced in function _DVERK
DVERK.LIB(dverk.obj) : error LNK2019: unresolved external symbol _write_i referenced in function _DVERK
LAPACK.LIB(xerbla.obj) : error LNK2001: unresolved external symbol _write_i
MINPACK1.LIB(d1mach.obj) : error LNK2001: unresolved external symbol _write_i
MINPACK1.LIB(i1mach.obj) : error LNK2001: unresolved external symbol _write_i
DVERK.LIB(dverk.obj) : error LNK2019: unresolved external symbol _f90_write referenced in function _DVERK
LAPACK.LIB(xerbla.obj) : error LNK2001: unresolved external symbol _f90_write
MINPACK1.LIB(d1mach.obj) : error LNK2001: unresolved external symbol _f90_write
MINPACK1.LIB(i1mach.obj) : error LNK2001: unresolved external symbol _f90_write
BLAS.LIB(dgemm.obj) : error LNK2001: unresolved external symbol _make_info
BLAS.LIB(dgemv.obj) : error LNK2001: unresolved external symbol _make_info
MINPACK1.LIB(qrfaq.obj) : error LNK2001: unresolved external symbol _make_info
MINPACK1.LIB(qrsolv.obj) : error LNK2001: unresolved external symbol _make_info
BLAS.LIB(dtrsm.obj) : error LNK2001: unresolved external symbol _make_info
BLAS.LIB(dsyrk.obj) : error LNK2001: unresolved external symbol _make_info
MINPACK1.LIB(lmder1.obj) : error LNK2001: unresolved external symbol _make_info
MINPACK1.LIB(enorm.obj) : error LNK2001: unresolved external symbol _make_info
MINPACK1.LIB(lmder.obj) : error LNK2019: unresolved external symbol _make_info referenced in function _LMDER
MINPACK1.LIB(lmpar.obj) : error LNK2001: unresolved external symbol _make_info
LAPACK.LIB(dposv.obj) : error LNK2001: unresolved external symbol _make_info
LAPACK.LIB(dpotrs.obj) : error LNK2001: unresolved external symbol _make_info
LAPACK.LIB(dpotrf.obj) : error LNK2001: unresolved external symbol _make_info
LAPACK.LIB(dpotf2.obj) : error LNK2001: unresolved external symbol _make_info
DVERK.LIB(dverk.obj) : error LNK2001: unresolved external symbol _make_info
DVERK.LIB(dverk.obj) : error LNK2001: unresolved external symbol _make_info
DVERK.LIB(dverk.obj) : error LNK2001: unresolved external symbol _make_info
LAPACK.LIB(dposvm.obj) : error LNK2001: unresolved external symbol _make_info
BLAS.LIB(dgemm.obj) : error LNK2001: unresolved external symbol __FFljj
BLAS.LIB(dscal.obj) : error LNK2001: unresolved external symbol __FFljj
BLAS.LIB(dgemv.obj) : error LNK2001: unresolved external symbol __FFljj
BLAS.LIB(ddot.obj) : error LNK2001: unresolved external symbol __FFljj
MINPACK1.LIB(d1mach.obj) : error LNK2001: unresolved external symbol __FFljj
MINPACK1.LIB(i1mach.obj) : error LNK2001: unresolved external symbol __FFljj
BLAS.LIB(dtrsm.obj) : error LNK2001: unresolved external symbol __FFljj
BLAS.LIB(dsyrk.obj) : error LNK2001: unresolved external symbol __FFljj
MINPACK1.LIB(lmpar.obj) : error LNK2001: unresolved external symbol __FFljj
MINPACK1.LIB(qrfaq.obj) : error LNK2001: unresolved external symbol __FFljj
MINPACK1.LIB(dpmpar.obj) : error LNK2001: unresolved external symbol __FFljj
MINPACK1.LIB(qrsolv.obj) : error LNK2001: unresolved external symbol __FFljj
LAPACK.LIB(ilaenv.obj) : error LNK2001: unresolved external symbol __FFljj
MINPACK1.LIB(lmder1.obj) : error LNK2001: unresolved external symbol __FFljj
MINPACK1.LIB(enorm.obj) : error LNK2001: unresolved external symbol __FFljj
MINPACK1.LIB(lmder.obj) : error LNK2001: unresolved external symbol __FFljj
LAPACK.LIB(dpotrs.obj) : error LNK2001: unresolved external symbol __FFljj
LAPACK.LIB(dpotrf.obj) : error LNK2019: unresolved external symbol __FFljj referenced in function _DPOTRF
LAPACK.LIB(lsame.obj) : error LNK2001: unresolved external symbol __FFljj
LAPACK.LIB(dpotf2.obj) : error LNK2001: unresolved external symbol __FFljj
DVERK.LIB(dverk.obj) : error LNK2001: unresolved external symbol __FFljj
LAPACK.LIB(dposvm.obj) : error LNK2001: unresolved external symbol __FFljj
LAPACK.LIB(dposv.obj) : error LNK2001: unresolved external symbol __FFljj
LAPACK.LIB(xerbla.obj) : error LNK2001: unresolved external symbol __FFljj
MINPACK1.LIB(qrsolv.obj) : error LNK2001: unresolved external symbol __FIfexp
DVERK.LIB(dverk.obj) : error LNK2019: unresolved external symbol __FIfexp referenced in function _DERIV
MINPACK1.LIB(enorm.obj) : error LNK2001: unresolved external symbol __FIfexp
MINPACK1.LIB(lmder.obj) : error LNK2001: unresolved external symbol __FIfexp
MINPACK1.LIB(qrfaq.obj) : error LNK2001: unresolved external symbol __FIfexp
DVERK.LIB(dverk.obj) : error LNK2019: unresolved external symbol __FIsign referenced in function _DVERK
LAPACK.LIB(dposvm.obj) : error LNK2019: unresolved external symbol __FIstrcpy@24 referenced in function _DPOSVM
LAPACK.LIB(ilaenv.obj) : error LNK2001: unresolved external symbol __FIstrcpy@24
LAPACK.LIB(xerbla.obj) : error LNK2019: unresolved external symbol _write_ch referenced in function _XERBLA
LAPACK.LIB(lsame.obj) : error LNK2019: unresolved external symbol __FIcleq@16 referenced in function _LSAME
LAPACK.LIB(ilaenv.obj) : error LNK2001: unresolved external symbol __FIcleq@16
MINPACK1.LIB(qrfaq.obj) : error LNK2001: unresolved external symbol __FIsqrt
MINPACK1.LIB(qrsolv.obj) : error LNK2001: unresolved external symbol __FIsqrt
LAPACK.LIB(dpotf2.obj) : error LNK2019: unresolved external symbol __FIsqrt referenced in function _DPOTF2
MINPACK1.LIB(enorm.obj) : error LNK2001: unresolved external symbol __FIsqrt
MINPACK1.LIB(lmder.obj) : error LNK2001: unresolved external symbol __FIsqrt
MINPACK1.LIB(lmpar.obj) : error LNK2001: unresolved external symbol __FIsqrt


0 Kudos
TimP
Honored Contributor III
790 Views
If you have a library which was built with a non-Intel Fortran compiler, it won't link against Intel Fortran run-time. It looks like it was built with a calling convention resembling stdcall. Many of the same functions come pre-compiled in the MKL library which comes with ifort Professional.
0 Kudos
Reply