LNK2001 Unresolved external symbol


Ian Taite


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

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"
"/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
"\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
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 *)"
CacheManager.lib(CContentEntryCache.obj) : error LNK2001: unresolved
external symbol "public: virtual int __thiscall
CacheManager.lib(CContentEntryCache.obj) : error LNK2001: unresolved
external symbol "public: virtual int __thiscall
CContentEntryCache::contentStart(class ATL::COleDateTime,int)"
..\Debug/Liberator.exe : fatal error LNK1120: 3 unresolved externals

Ronald Laeremans [MSFT]

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


Ronald Laeremans
Visual C++ team


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.

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question