error LNK2019: unresolved external symbol
- From: Bob <yesbkay@xxxxxxxxx>
- Date: Wed, 12 Sep 2007 15:27:27 -0700
I created a "Win 32 Project" with these three simple files, but when I
try to link, I get a LNK2019 error, I think it is a project setting,
but canone throw some light on this?
Thanks,
Bob
// FooBase.h
#ifndef _FooBase_h
#define _FooBase_h
class FooBase
{
public:
virtual ~FooBase();
virtual int GetNumber() = 0;
protected:
FooBase();
};
#endif _FooBase_h
// Foo.h
#ifndef _Foo_h
#define _Foo_h
#include "FooBase.h"
class Foo : virtual public FooBase
{
public:
Foo();
~Foo();
int GetNumber();
};
#endif _Foo_h
// Foo.cpp
#include "Foo.h"
Foo::Foo() : FooBase() {}
Foo::~Foo() {}
int Foo::GetNumber()
{
return 5;
}
Error 1 error LNK2019: unresolved external symbol "protected:
__thiscall FooBase::FooBase(void)" (??0FooBase@@IAE@XZ) referenced in
function "public: __thiscall Foo::Foo(void)" (??0Foo@@QAE@XZ) Foo.obj
Error 2 error LNK2019: unresolved external symbol "public: virtual
__thiscall FooBase::~FooBase(void)" (??1FooBase@@UAE@XZ) referenced in
function "public: void __thiscall Foo::`vbase destructor'(void)" (??
_DFoo@@QAEXXZ) Foo.obj
Error 3 fatal error LNK1120: 2 unresolved externals C:\scratch\Scratch
\Debug\CPP.dll
.
- Follow-Ups:
- Re: error LNK2019: unresolved external symbol
- From: Norbert Unterberg
- Re: error LNK2019: unresolved external symbol
- From: Igor Tandetnik
- Re: error LNK2019: unresolved external symbol
- Prev by Date: Changing ActiveX control Property ID
- Next by Date: Re: error LNK2019: unresolved external symbol
- Previous by thread: Changing ActiveX control Property ID
- Next by thread: Re: error LNK2019: unresolved external symbol
- Index(es):
Relevant Pages
|