Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / October 2004

Tip: Looking for answers? Try searching our database.

Link error LNK2020 in VC7.1

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vickie - 28 Oct 2004 20:05 GMT
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
Signature

meakanu

Gabest - 28 Oct 2004 20:18 GMT
Sounds like the project has the mutithreaded debug runtime set and you added
msvcrtd.lib by hand too.
Vickie - 28 Oct 2004 21:39 GMT
> 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

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.