LNK2001 Unresolved external symbol

From: Ian Taite (ian.taite_at_zen.co.uk)
Date: 09/09/04


Date: 9 Sep 2004 08:58:03 -0700

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



Relevant Pages

  • Re: .EXE -> .ASM -> .EXE
    ... passing the '-static' and '-static-libgcc' linker ... object modules, a size of 437 kB still seems inordinately large. ... This is most likely a source organization problem. ... library for example is organized so that each function compiles to a ...
    (alt.lang.asm)
  • newbie linking IoXxx routines problem
    ... While writing a small test driver from ... linker cannot find IoCreateSymbolicLink ... while it compiles and links perfectly if the call to IoWriteErrorLogEntry is ...
    (microsoft.public.development.device.drivers)
  • Re: WSAStartup()
    ... I added ws2.lib as an Additional Dependency for the linker and all now ... compiles, links and runs on my eBox fine, even though it does nothing). ... unresolved external symbol _WSAStartup referenced ...
    (microsoft.public.windowsce.platbuilder)
  • Re: MSVC 7.1 Compile Time Slowdown
    ... When you are using global optimizations the linker effectively "compiles" the code, ... I donīt know it for sure, but it seems that the "linker" is doing something like a full ... I would recommend global optimization only for release builds, ... I wonder why you experience such a high difference in code size, ...
    (microsoft.public.vc.ide_general)