Discussion:
Linking error in VS2008(vc++)
(too old to reply)
Ashish
2008-10-08 10:36:46 UTC
Permalink
I'm making a project in vc9 in visual studio 2008.

When i compile my project there are some linking errors like:

1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _sprintf already defined in
libcmtd.lib(sprintf.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _memchr already defined in
libcmtd.lib(memchr.obj)

To fix above errors i add libcmtd.lib in "ignore specific library" under
project setting in linker tab.. But now i'm getting following 2 errors and
dont way the way to fix them.

1>nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol
___argv
1>nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol
___argc

Please suggest how to fix them.

And mfc42d.lib is part of VC6. This library is not present in VS2008. What's
the replacement of this library in VS2008.
Ulrich Eckhardt
2008-10-08 11:19:15 UTC
Permalink
Post by Ashish
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _sprintf already defined in
libcmtd.lib(sprintf.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _memchr already defined in
libcmtd.lib(memchr.obj)
This means you are mixing different runtimes with each other. Check that all
code uses the same one.
Post by Ashish
To fix above errors i add libcmtd.lib in "ignore specific library" under
project setting in linker tab..
That's not a fix, never. It is just something that turns off an
errormessage.
Post by Ashish
And mfc42d.lib is part of VC6. This library is not present in VS2008.
What's the replacement of this library in VS2008.
What does that MFC lib have to do with all this? In any case, you must be
aware of the fact that you can't mix C++ code compiled with different
compilers into one binary. If you have any objectfiles or libs referencing
VC6 stuff, you need to recompile them.

Uli
--
C++ FAQ: http://parashift.com/c++-faq-lite

Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932
Loading...