Jump to content
  • Advertisement
Sign in to follow this  
Adam West

red november game unresolved external

This topic is 2381 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hey there, im making a quick fps game with irrlicht and i've stumbled upon a flaw already.

i keep getting an unresolved external symbol from the linker at compile time:
the code looks fine to me? can you help me?



main.h

#ifndef MAIN_H_
#define MAIN_H_
#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;

//globals
class redNovember
{
public:
// always initialize class-members in the constructor - especially set pointers to 0!
redNovember() : device(0), driver(0), smgr(0),guienv(0)
{}
~redNovember();
void initIrrlicht();
void renderScene();
int shutdown();
IrrlichtDevice *device;
IVideoDriver* driver;
ISceneManager* smgr;
IGUIEnvironment* guienv;
};
extern redNovember SYS;

// every other global you would need can instead of being global just be put in here.
#endif


main.cpp

#include "main.h"

void redNovember::renderScene()
{
while(device->run())
{
driver->beginScene(true,true,SColor(255,100,101,140));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}
}
int redNovember::shutdown()
{
device->drop();
return 0;
}
int main()
{
SYS.initIrrlicht();

///put main shit in here
SYS.renderScene();
SYS.shutdown();
}


initialize.cpp

#include "main.h"

void redNovember::initIrrlicht()
{
device = createDevice(EDT_OPENGL, dimension2d<u32>(800, 600), 32,
false, false, false, 0);
device->setWindowCaption(L"Project: Red November");
driver = device->getVideoDriver();
smgr = device->getSceneManager();
guienv = device->getGUIEnvironment();
}




this is the error output:

Error 1 error LNK2001: unresolved external symbol "class redNovember SYS" (?SYS@@3VredNovember@@A) C:\Users\adam\documents\visual studio 2010\Projects\RedNovember\RedNovember\main.obj


thanks in advance :)

Share this post


Link to post
Share on other sites
Advertisement
You've declared the extern variable SYS but never actually defined it. Define it someplace and the error will go away.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!