Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
23 Views

Unresolved Externals when I Switch to Runtime Library=Multithreaded

I am trying to statically link the MKL libraries into my application by setting Fortran => Libraries => Runtime Library = "Multithreaded" in Windows Fortran XE Pro 17.0 Update 2 with VS2015. In the 32-bit version I get the following:

LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library

followed by:

MSVCRT.lib(_chandler4gs_.obj) : error LNK2019: unresolved external symbol __except_handler4_common referenced in function __except_handler4.

If I switch to Fortran => Libraries => Runtime Library = "Multithread DLL" and don't change anything else then it works fine. The 64-bit version works fine with either "Multithread DLL" or "Multithreaded" and so it is just a 32-bit problem. If I use /NODEFAULTLIB:library​ (as suggested in the first error message) then I get a whole lot of other unresolved externals.

​I have attached the vfproj and BuildLog files for both the Multithread DLL and Multithreaded versions. Just look at the 32-bit Release settings in the vfproj. What am I doing wrong?
 

0 Kudos
5 Replies
Highlighted
Beginner
23 Views

The first error was actually

The first error was actually libucrt.lib(log10.obj) : error LNK2005: _log10 already defined in libmmd.lib(libmmd.dll)​

0 Kudos
Highlighted
23 Views

Your project depends on two

Your project depends on two additional libraries: "FortranLib.Lib PlateLib.Lib". If they were generated by Intel Fortran compiler did you set the same runtime library type for them?

 

Thanks,

Xiaoping Duan

Intel Customer Support

0 Kudos
Highlighted
Beginner
23 Views

Xiaoping, I had FortranLib

Xiaoping, I had FortranLib.lib and PlateLib.lib set to Multithreaded DLL (different to the main application) because I thought since they are just libraries their runtime library setting wouldn't matter. I have changed them to match the main application and it now works!! Thanks.

​I just have one more question - In the main application (SGSolver) library settings I have set /winapp and /Qmkl:parallel. Should I be using these same settings in FortranLib.lib and PlateLib.lib too or doesn't it matter?

​Peter

0 Kudos
Highlighted
23 Views

Quote:schulzey wrote:

schulzey wrote:

​I just have one more question - In the main application (SGSolver) library settings I have set /winapp and /Qmkl:parallel. Should I be using these same settings in FortranLib.lib and PlateLib.lib too or doesn't it matter?

​Peter

Both options will let compiler add directives to the generated object files so that some specific libraries can be linked without being explicitly provided to the linkage command line.

If the main application project has already set them you don't need set them again in FortranLib.lib and PlateLib.lib.

 

Thanks,

Xiaoping Duan

Intel Customer Support

0 Kudos
Highlighted
Beginner
23 Views

Thanks Xiaoping, problem

Thanks Xiaoping, problem solved!

0 Kudos