469,600 Members | 2,554 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,600 developers. It's quick & easy.

Link error LNK2020 in VC7.1

I have a very simple program with some computations.
After using NODEFAULTLIB to get rid of LNK2005 errors such as:
LIBCMT.lib(crt0dat.obj) : error LNK2005: _exit already defined in
msvcrtd.lib(MSVCR71D.dll)

Now I have two new LNK2020 errors:
LINK : error LNK2020: unresolved token (0A000021) std._Lockit.__dtor
LINK : error LNK2020: unresolved token (0A000022) _DebugHeapTag
LINK : fatal error LNK1120: 2 unresolved externals

I am not sure which LIB I need to include. The command line has

/NOLOGO /NODEFAULTLIB /DEBUG /ASSEMBLYDEBUG
/MAP /MAPINFO:EXPORTS /MACHINE:X86 /FIXED:No msvcrtd.lib kernel32.lib
user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

Any suggestions? Thanks!

Vickie
--
meakanu
Nov 17 '05 #1
2 1548
Sounds like the project has the mutithreaded debug runtime set and you added
msvcrtd.lib by hand too.
Nov 17 '05 #2


"Gabest" wrote:
Sounds like the project has the mutithreaded debug runtime set and you added
msvcrtd.lib by hand too.

Hello "Gabest",

Thank you for your suggestion. I checked the project property settings and
I have -
Runtime Library of C++ Code Generation set at Single Thread(/ML).
Are there some other tabs that might have been set to "mutithreaded debug
runtime"?
I am enclosing more command lines and hopefully that give some clue.

Creating temporary file "d:\Transmodel\Debug\RSP00004B.rsp" with contents
[
/Od /AI "system.dll" /AI "mscorlib.dll" /AI "D:\Transmodel\Debug" /D "WIN32"
/D "_DEBUG" /D "_MBCS" /FD /EHsc /Yu"stdafx.h" /Fp"Debug/Transmodel.pch" /Fx
/Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /c /Zi /clr /TP /showIncludes /FU
"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\mscorl ib.dll"
/FU "C:\WINNT\Microsoft.NET\Framework\v1.1.4322\System .dll"
/FU "C:\WINNT\Microsoft.NET\Framework\v1.1.4322\System .Data.dll"
".\Transmodel.cpp"
".\AssemblyInfo.cpp"
]
Creating command line "cl.exe @"d:\Transmodel\Debug\RSP00004B.rsp" /nologo"
Creating temporary file "d:\Transmodel\Debug\RSP00004C.rsp" with contents
[
/Od /AI "system.dll" /AI "mscorlib.dll" /AI "D:\Transmodel\Debug" /D "WIN32"
/D "_DEBUG" /D "_MBCS" /FD /EHsc /Yc"stdafx.h" /Fp"Debug/Transmodel.pch" /Fx
/Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /c /Zi /clr /TP /showIncludes /FU
"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\mscorl ib.dll"
/FU "C:\WINNT\Microsoft.NET\Framework\v1.1.4322\System .dll"
/FU "C:\WINNT\Microsoft.NET\Framework\v1.1.4322\System .Data.dll"
".\stdafx.cpp"
]
Creating command line "cl.exe @"d:\Transmodel\Debug\RSP00004C.rsp" /nologo"
Creating temporary file "d:\Transmodel\Debug\RSP00004D.rsp" with contents
[
/OUT:"D:\Transmodel\Debug\Transmodel.exe" /INCREMENTAL:NO /NOLOGO
/NODEFAULTLIB /DEBUG /ASSEMBLYDEBUG /PDB:"D:\Transmodel\Debug/Transmodel.pdb"
/MAP /MAPINFO:EXPORTS /MACHINE:X86 /FIXED:No msvcrtd.lib kernel32.lib
user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
".\Debug\AssemblyInfo.obj"
".\Debug\stdafx.obj"
".\Debug\Transmodel.obj"
".\Debug\app.res"

Thank you for your help!

Vickie
Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Peter | last post: by
10 posts views Thread by Ian Lazarus | last post: by
4 posts views Thread by Jun | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.