Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

LNK 2005 error linking static library - common item in MSVCRTD.lib(ti_inst.obj) and LIBCMTD.lib(typinfo.obj)

$
0
0

I get the following LNK2005 error messages relating to something in file MSVCRTD.lib(ti_inst.obj) being already defined in LIBCMTD.lib(typinfo.obj) when linking a static library file to a wrapper in Visual Studio 2012 Update 4:

  • Error    1     error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)    [File:   MSVCRTD.lib(ti_inst.obj)    ]
  • Error    2     error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)    [File:  MSVCRTD.lib(ti_inst.obj)    ]
  • Warning    3     warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library    [File: LINK    ]

I have started to modify my program to enhance its capabilities.  However, an error has occurred in the existing version so that
I have had to re-build it so that I can debug it.  It creates a static library.  This is the error I get when I try to link it with the wrapper program that runs it.  I can't find much on this subject via an Internet search other than the question of what to do about it.  Could it have something to do with the new version of the compiler (Fortran 15)?  The wrapper's link properties already specify to

                     Ignore Specific Library: libcmt

If I add libcmtd to the list of libraries to ignore and re-build, I still get the same messages!!  Quite disappointing!  Similarly for MSVCRTD.

If I specify to ignore all default libraries, as seems to be suggested in the Warning, many errors emerge.

It looks like something has changed, presumably in the build of my library, but I can't see what it is.  The same error messages occur if I make the change to "Ignore" MSVCRTD" in building the static library.    If I also "Ignore "MSVCRTD" in building the wrapper I get more error messages - this time relating to LIBCMTD.lib (in file libcmt.lib(invarg.obj)).

Hope someone else has had this issue before and can suggest something to try!

Warwick


Viewing all articles
Browse latest Browse all 5691

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>