Hi, have come across these link errors, but an not sure what they mean , tried troubleshooting but have drawn blank. Any help would be appreciated, thannk you
Error 4 error LNK2019: unresolved external symbol "public: virtual __thiscall CStateT<class CGame,struct irr::SEvent>::~CStateT<class CGame,struct irr::SEvent>(void)" (??1?$CStateT@VCGame@@USEvent@irr@@@@UAE@XZ) referenced in function __unwindfunclet$??0CGlobalState@@QAE@XZ$0 CGlobalState.obj
Error 5 error LNK2001: unresolved external symbol "public: virtual __thiscall CStateT<class CGame,struct irr::SEvent>::~CStateT<class CGame,struct irr::SEvent>(void)" (??1?$CStateT@VCGame@@USEvent@irr@@@@UAE@XZ) COptionState.obj
Link Error
-
- Posts: 9
- Joined: Wed Jul 28, 2010 8:12 pm
These classes throw an error because they have own destructor
in use
Have i unknowingly created duplicates. Should i put the classes with this error into the same cpp file.?
in use
Code: Select all
class CPausedState : public CStateT<CGame, SEvent>
{
public:
////!
CPausedState():;
//!//!
virtual ~CPausedState(); // Having this invokes the link error removing it helps
-
- Posts: 9
- Joined: Wed Jul 28, 2010 8:12 pm
I figured out a fix which was to implement the destructor within the cpp file, however now i get this from the main.
Error 2 error LNK2019: unresolved external symbol "public: virtual __thiscall CStateGraphT<class CGame,struct irr::SEvent>::~CStateGraphT<class CGame,struct irr::SEvent>(void)" (??1?$CStateGraphT@VCGame@@USEvent@irr@@@@UAE@XZ) referenced in function __unwindfunclet$??0CGame@@QAE@PAVIrrlichtDevice@irr@@@Z$0 main.obj
Error 3 error LNK2019: unresolved external symbol "public: virtual __thiscall CStateT<class CGame,struct irr::SEvent>::~CStateT<class CGame,struct irr::SEvent>(void)" (??1?$CStateT@VCGame@@USEvent@irr@@@@UAE@XZ) referenced in function __unwindfunclet$??0CGlobalState@@QAE@XZ$0 main.obj
What does function _unwindfunclet$ mean?
This is CGame
Error 2 error LNK2019: unresolved external symbol "public: virtual __thiscall CStateGraphT<class CGame,struct irr::SEvent>::~CStateGraphT<class CGame,struct irr::SEvent>(void)" (??1?$CStateGraphT@VCGame@@USEvent@irr@@@@UAE@XZ) referenced in function __unwindfunclet$??0CGame@@QAE@PAVIrrlichtDevice@irr@@@Z$0 main.obj
Error 3 error LNK2019: unresolved external symbol "public: virtual __thiscall CStateT<class CGame,struct irr::SEvent>::~CStateT<class CGame,struct irr::SEvent>(void)" (??1?$CStateT@VCGame@@USEvent@irr@@@@UAE@XZ) referenced in function __unwindfunclet$??0CGlobalState@@QAE@XZ$0 main.obj
What does function _unwindfunclet$ mean?
This is CGame
Code: Select all
#ifndef _C_Game_H_
#define _C_Game_H_
#include <irrlicht.h>
#include "CStateT.h"
#include "CStateGraphT.h"
using namespace irr;
using namespace video;
using namespace scene;
using namespace gui;
using namespace core;
class CGame : public IEventReceiver , public CStateGraphT<CGame, SEvent>
{
public:
//!
CGame(IrrlichtDevice* device): CStateGraphT<CGame, SEvent>(this), Device(device)
{
Device->grab();
Device->setEventReceiver(this);
}
//!
virtual ~CGame()
{
Device->setEventReceiver(0);
Device->drop();
}
//! call through methods
ISceneManager* getSceneManager() const{
return Device->getSceneManager();
}
gui::IGUIEnvironment* getUserInterface() const
{
return Device->getGUIEnvironment();
}
video::IVideoDriver* getVideoDriver() const
{
return Device->getVideoDriver();
}
ITimer* getTimer() const
{
return Device->getTimer();
}
void setDevice(IrrlichtDevice* device)
{
if (Device) {
Device->setEventReceiver(0);
Device->drop();
}
Device = device;
if (Device) {
Device->grab();
Device->setEventReceiver(this);
}
}
IrrlichtDevice* getDevice()
{
return Device;
}
bool run()
{
return Device->run();
}
//!
CStateT<CGame, SEvent>* findGameState(const char* name)
{
s32 f = States.binary_search(SState(name));
if (f != -1)
return States[f].State;
return 0;
}
//!
void addGameState(const char* name, CStateT<CGame, SEvent>* state)
{
States.push_back(SState(name, state));
}
//! adapt from irrlicht event handling to ours
virtual bool OnEvent(const SEvent& event)
{
return onEvent(event);
}
private:
IrrlichtDevice* Device;
struct SState
{
SState(const c8* name = 0, CStateT<CGame, SEvent>* state = 0)
: Name(name)
, State(state)
{
}
bool operator<(const SState& other) const
{
return strcmp(Name, other.Name) < 0;
}
const c8* Name;
CStateT<CGame, SEvent>* State;
};
core::array<SState> States;
};
#endif