Link error LNK2020 in VC7.1

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
Sounds like the project has the mutithreaded debug runtime set and you added
msvcrtd.lib by hand too.
 
Gabest said:
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\mscorlib.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\mscorlib.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
 
Back
Top