Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

LNK2005 error

shukri_d_
Beginner
244 Views

New to this development environment - in fact my very first project.  I get the following link errors:

Error 1  error LNK2005: _for_emit_diagnostic already defined in libifcoremd.lib(libifcoremd.dll) libifcoremt.lib(for_diags_intel.obj) 
Error 2  error LNK2005: _for_set_reentrancy already defined in libifcoremd.lib(libifcoremd.dll) libifcoremt.lib(for_reentrancy.obj) 
Error 3  error LNK2005: _for_close already defined in libifcoremd.lib(libifcoremd.dll) libifcoremt.lib(for_close.obj) 
Error 4  error LNK2005: _for_open already defined in libifcoremd.lib(libifcoremd.dll) libifcoremt.lib(for_open.obj) 
Error 5  error LNK2005: _for_write_seq already defined in libifcoremd.lib(libifcoremd.dll) libifcoremt.lib(for_wseq.obj) 
Error 6  fatal error LNK1169: one or more multiply defined symbols found Debug\spcalz.exe 
 

Here's the linker command line:

/OUT:"Debug\spcalz.exe" /VERBOSE /INCREMENTAL:NO /NOLOGO /NODEFAULTLIB:"libcd" /NODEFAULTLIB:"msvcrtd" /NODEFAULTLIB:"libcmt" /NODEFAULTLIB:"mscvcr90.dll" /NODEFAULTLIB:"libcmtd" /NODEFAULTLIB:"dformd.lib" /NODEFAULTLIB:"dfconsol.lib" /NODEFAULTLIB:"dfport.lib" /MANIFEST /MANIFESTFILE:"N:\ENGLIB\spcalz\Debug\spcalz.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"N:\ENGLIB\spcalz\Debug\spcalz.pdb" /MAP /SUBSYSTEM:CONSOLE libifport.lib glbspds.lib glbsds.lib dsssys_c.lib dsssys_f.lib dsslib_c.lib dsslib_f.lib gdiplus.lib gdi32.lib winspool.lib wsock32.lib odbc32.lib glbpms.lib advapi32.lib kernel32.lib winmm.lib libifcoremd.lib

This was copied from an existing project that does not procude the linker error.  Only addition is glbspds.lib.  I would appreciate any assistance in resolving these errors.

Thank you in advance for the support ...

0 Kudos
2 Replies
TimP
Black Belt
244 Views
You're switching among static libraries (which used to be default) and dynamic , and maybe into debug. If your compile and link settings are consistent with your nodefaultlib settings a full rebuild should work.
shukri_d_
Beginner
244 Views

Thank you Tim for the quick response!

I'm aware that what I have is a conflict between static and dynamic libraries - I just have not been able to resolve this!!  I'm really new to this development environment.  Here are the compiler and linker command lines:

Compiler:

/nologo /debug:full /Od /I" " /D_NEWUI /D_PID24 /D_NOLICENSE /fixed /extend_source:132 /Qsave /align:commons /names:lowercase /iface:cref /assume:underscore /module:"Debug/" /object:"Debug/" /Fd"Debug\vc110.pdb" /traceback /check:bounds /libs:dll /threads /c

Linker:

/OUT:"Debug\spcalz.exe" /VERBOSE /INCREMENTAL:NO /NOLOGO /NODEFAULTLIB:"libcd" /NODEFAULTLIB:"msvcrtd" /NODEFAULTLIB:"libcmt" /NODEFAULTLIB:"mscvcr90.dll" /NODEFAULTLIB:"libcmtd" /NODEFAULTLIB:"dformd.lib" /NODEFAULTLIB:"dfconsol.lib" /NODEFAULTLIB:"dfport.lib" /MANIFEST /MANIFESTFILE:"N:\ENGLIB\spcalz\Debug\spcalz.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"N:\ENGLIB\spcalz\Debug\spcalz.pdb" /MAP /SUBSYSTEM:CONSOLE libifport.lib glbspds.lib glbsds.lib dsssys_c.lib dsssys_f.lib dsslib_c.lib dsslib_f.lib gdiplus.lib gdi32.lib winspool.lib wsock32.lib odbc32.lib glbpms.lib advapi32.lib kernel32.lib winmm.lib libifcoremd.lib

In the end I need to use the dynamic library as that will allow for sharing data between processes.

Any help you offer will be appreciated.  Thanks again.

Reply