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

linker error - multiply defined symbols from libifcoredmdd.lib

lindsaydale
Beginner
861 Views

I am creating a .exe for code that was created for DVF. Compiles fine and links using an external .lib file that I have  referenced in the dependency parameter.  I am getting 5 error and 1 warning message :

Error  fatal error LNK1169: one or more multiply defined symbols found  Debug\EXEMODEL1.exe  

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)  

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

 

I did try the warning suggestion, but it resulted in many missing references !

I've searched for libifcoremdd but can find no relevant articles. 

0 Kudos
1 Solution
Steve_Lionel
Honored Contributor III
849 Views

Your library and your executable project were built with different settings for the run-time library to use. One was set to use the static, non-debug library (libifcoremt.lib), one was set to use the DLL debug library (libifcoremdd.lib). The ideal solution is to set the library  project property "Fortran > Libraries > Disable default library search rules" to Yes, then rebuild it. This will then make the choice of library dependent on the executable project.

If you can't do that, then change the property Fortran > Libraries > Use Runtime Library to match that of the .LIB you are linking to. I recommend against using /NODEFAULTLIB as a solution here.

View solution in original post

1 Reply
Steve_Lionel
Honored Contributor III
850 Views

Your library and your executable project were built with different settings for the run-time library to use. One was set to use the static, non-debug library (libifcoremt.lib), one was set to use the DLL debug library (libifcoremdd.lib). The ideal solution is to set the library  project property "Fortran > Libraries > Disable default library search rules" to Yes, then rebuild it. This will then make the choice of library dependent on the executable project.

If you can't do that, then change the property Fortran > Libraries > Use Runtime Library to match that of the .LIB you are linking to. I recommend against using /NODEFAULTLIB as a solution here.

Reply