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++ / September 2004

Tip: Looking for answers? Try searching our database.

LNK2001 Unresolved external symbol

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ian Taite - 09 Sep 2004 16:58 GMT
Help,

I am trying to nail a linking problem, to avoid having to lose about 2
weeks work. I have a backup of my project that compiles and links OK
however changes I made sometime since then have resulted in the
solution not linking with the error below.

The solution comprises of six projects. Five are static library
projects which compile ok. The sixth is an EXE than needs to link in
the other five .lib files. In the evidence below, interface
IContentStream defines three functions namely contentStart,
contentComplete and contentEntry. In the header for IContentStream,
these three methods are declared pure virtual. CContentEntryCache is a
class that implements IContentStream. CacheManager.lib should contain
three classes: CCacheManager, CContentEntryCache and CCacheModule. I
think I have checked the obvious such as making sure the folder holding
the CacheManager.lib file is in the linker/general/additional library
directories and linker/input/additional dependencies names
CacheManager.lib. I am using unmanaged C++ in VS 2003 and I have not
found inspiration by looking at the MSDN help for LNK2001.

Any offers of help would be appreciated, here's some of the linker
output:

Compiling...
LiberatorApp.cpp
Linking...
Microsoft (R) Incremental Linker Version 7.10.3077
Copyright (C) Microsoft Corporation.  All rights reserved.
"/OUT:.\Debug/Liberator.exe" /INCREMENTAL:NO
"/LIBPATH:..\CacheManager\Debug" "/LIBPATH:..\Common\Debug"
"/LIBPATH:..\statistics\debug" "/LIBPATH:..\TransmissionManager\Debug"
"/LIBPATH:..\TransmitterCarouselManager\Debug"
"/NODEFAULTLIB:msvcrtd.lib" "/NODEFAULTLIB:msvcprtd.lib"
"/DELAYLOAD:OleAcc.dll" /DEBUG "/PDB:.\Debug/Liberator.pdb"
/SUBSYSTEM:WINDOWS /MACHINE:X86 ws2_32.lib Common.lib
StatisticsManager.lib TransmissionManager.lib
TransmitterCarouselManager.lib CacheManager.lib DelayImp.lib
"\Ti2000\Liberator Wont Link\Statistics\Debug\StatisticsManager.lib"
"\Ti2000\Liberator Wont
Link\TransmitterCarouselManager\Debug\TransmitterCarouselManager.lib"
"\Ti2000\Liberator Wont Link\Common\Debug\common.lib"
"\Ti2000\Liberator Wont Link\CacheManager\Debug\CacheManager.lib"
"\Ti2000\Liberator Wont
Link\TransmissionManager\Debug\TransmissionManager.lib" DelayImp.lib
".\Debug\Liberator.obj"
".\Debug\LiberatorApp.obj"
".\Debug\LiberatorAppKeys.obj"
".\Debug\LiberatorEventHandler.obj"
".\Debug\LiberatorInfo.obj"
".\Debug\StdAfx.obj"
".\Debug\Liberator.res"
LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to
'/INCREMENTAL:NO' specification
CacheManager.lib(CContentEntryCache.obj) : error LNK2001: unresolved
external symbol "public: virtual int __thiscall
CContentEntryCache::contentEntry(class CCyclicContent *)"
(?contentEntry@CContentEntryCache@@UAEHPAVCCyclicContent@@@Z)
CacheManager.lib(CContentEntryCache.obj) : error LNK2001: unresolved
external symbol "public: virtual int __thiscall
CContentEntryCache::contentComplete(void)"
(?contentComplete@CContentEntryCache@@UAEHXZ)
CacheManager.lib(CContentEntryCache.obj) : error LNK2001: unresolved
external symbol "public: virtual int __thiscall
CContentEntryCache::contentStart(class ATL::COleDateTime,int)"
(?contentStart@CContentEntryCache@@UAEHVCOleDateTime@ATL@@H@Z)
.\Debug/Liberator.exe : fatal error LNK1120: 3 unresolved externals
Ronald Laeremans [MSFT] - 19 Sep 2004 20:54 GMT
Can you link with the "/verbose" option (in the IDE it is called "show
progress messages" in one of the linker options panes) to see whether the
lib is indeed included in the search? And if so, can you dump the lib to see
whether these symbols are defined in the lib (and with the correct
signature)?

Thanks.

Ronald Laeremans
Visual C++ team

> Help,
>
[quoted text clipped - 63 lines]
> (?contentStart@CContentEntryCache@@UAEHVCOleDateTime@ATL@@H@Z)
> .\Debug/Liberator.exe : fatal error LNK1120: 3 unresolved externals
Ian Taite - 22 Sep 2004 12:41 GMT
Sorry for not replying sooner as I was out of the country. I've solved the
problem myself by reverting to the earlier project and rolling forward the
changes, a process that was easier than I expected. The problem I reported
was caused by renaming classes, so the error message shown in the original
post was correct, only I did not realise that due to the large number of
changes I made overall. The lesson learned is probably to backup the
workspace folder tree frequently and make changes in a more controlled way,
both of which I now do. Thanks anyway.
Ian.

> Can you link with the "/verbose" option (in the IDE it is called "show
> progress messages" in one of the linker options panes) to see whether the
[quoted text clipped - 74 lines]
> > (?contentStart@CContentEntryCache@@UAEHVCOleDateTime@ATL@@H@Z)
> > .\Debug/Liberator.exe : fatal error LNK1120: 3 unresolved externals

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.