C++ Question Unresolved External Symbol problem

DesideriusPapp

New member
Joined
May 23, 2009
Messages
21
Reaction score
0
Points
0
Hi all!

This is my first post after my 'Hello' one in Announcements, so let me greet you all.

I've started making my first dll and I'm stuck - I believe I've thoroughly searched this forum and other sources for a solution but I don't seem to be able to solve this on my own.

I'm using VC++ 2008 Express.

I've setup the compiler according to the Wiki, successfully compiled ShuttlePB and then made some changes and again successfully compiled. Then I went for an animation.

From my understanding (I'm no programmer nor have previous experiences with C++), for animations I had to make an header file to define my class, so that I can make a constructor in the main .cpp file. So I think I did.

In the header file I included orbitersdk.h and put the following:

class Strelka: public VESSEL2 {
public:
Strelka (OBJHANDLE hVessel, int fmodel);
~Strelka ();
void clbkSetClassCaps (FILEHANDLE cfg);
private:
void DefineAnimations();
UINT BayAnimation;
};

then in the main .cpp I included the header file and put:

Strelka::Strelka(OBJHANDLE hVessel, int fmodel)
: VESSEL2 (hVessel, fmodel) {}

I'm reasonably sure the problem lies here because it's the only change to the previously working version of the code.

Anyway, the error is:

1>------ Build started: Project: Strelka, Configuration: Release Win32 ------
1>Compiling...
1>Strelka.cpp
1>Linking...
1> Creating library ..\..\..\Orbiter\Modules\Strelka.lib and object ..\..\..\Orbiter\Modules\Strelka.exp
1>Strelka.obj : error LNK2001: unresolved external symbol "public: __thiscall Strelka::~Strelka(void)" (??1Strelka@@$$FQAE@XZ)
1>..\..\..\Orbiter\Modules\Strelka.dll : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://d:\Strelka Design Project\Strelka\Strelka\Release\BuildLog.htm"
1>Strelka - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

can anyone help me out or put me on the right track?

Thank you in advance!
 

DarkWanderer

Active member
Orbiter Contributor
Donator
Joined
Apr 27, 2008
Messages
213
Reaction score
83
Points
43
Location
Moscow
Either add realization for destructor (~Strelka()) in the .cpp or remove it from the .h file.
 
Top