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

Problem linking external lib in VS2017 and IPSXE20

carneiro__fernando
625 Views

Would there be any problem to link old libs to a project created by VS2017 and IPSXE20?

I did:

project > properties > linker > general > additional library directories: "entered the path for my lib files"

then

project > properties > linker > input > additional dependencies: "entered the name of the files I wanted to link"

 

When I add no lib I have the unresolved external symbol error for: DGEMM, DGETRF, DGTRI, DGGEV, DGETRS

When I add BLASd.lib I additionally get the errors:

Severity    Code    Description    Project    File    Line    Suppression State
Error        error LNK2005: for_close already defined in libifcoremdd.lib(libifcoremdd.dll)        libifcoremt.lib(for_close.obj)        
Error        error LNK2005: for_emit_diagnostic already defined in libifcoremdd.lib(libifcoremdd.dll)        libifcoremt.lib(for_diags_intel.obj)        
Error        error LNK2005: for_open already defined in libifcoremdd.lib(libifcoremdd.dll)        libifcoremt.lib(for_open.obj)        
Error        error LNK2005: for_set_reentrancy already defined in libifcoremdd.lib(libifcoremdd.dll)        libifcoremt.lib(for_reentrancy.obj)        
Error        error LNK2005: for_cpusec already defined in libifcoremdd.lib(libifcoremdd.dll)        libifcoremt.lib(for_secnds.obj)        
Error        error LNK2005: for_deallocate already defined in libifcoremdd.lib(libifcoremdd.dll)        libifcoremt.lib(for_vm.obj)        
Error        error LNK2005: for_dealloc_allocatable already defined in libifcoremdd.lib(libifcoremdd.dll)        libifcoremt.lib(for_vm.obj)        
Error        error LNK2005: for_check_mult_overflow64 already defined in libifcoremdd.lib(libifcoremdd.dll)        libifcoremt.lib(for_vm.obj)        
Error        error LNK2005: for_allocate already defined in libifcoremdd.lib(libifcoremdd.dll)        libifcoremt.lib(for_vm.obj)        
Error        error LNK2005: for_alloc_allocatable already defined in libifcoremdd.lib(libifcoremdd.dll)        libifcoremt.lib(for_vm.obj)        
 

And when I add LAPACKd.lib, errors for DGEMM, DGETRF, DGTRI, DGGEV, DGETRS disapear, but those error LNK2005 shown above remain...

 

I am really worried there might be a problem using those old libs in recent IDE and Compilers... which would be a serious problem

0 Kudos
1 Reply
Steve_Lionel
Honored Contributor III
625 Views

The problem is that the "old libs" were built in a way that causes the linker to pull in a specific set of the Intel Fortran run-time libraries, but your executable program specifies a different set. It isn't a version difference that's the issue. You are mixing the debug DLL libraries and the non-debug static libraries. I can't tell from what you've included which is which.

Since the current Intel Fortran default is DLL libraries, I'm guessing that the "old libs" were built to use the static libraries. Ideally, a static Fortran library is built with the option to NOT pull in any of the run-time libraries by default (/libdir:noauto), but if these were to also be used with C or C++, that may not have been set.

Try this first - in your project, set the project property Linker > Input > Ignore Specific Library to: libifcoremt.lib

See what that does.

0 Kudos
Reply