Jump to content
  • Advertisement
Sign in to follow this  
RevBlueJeans

[RESOLVED] Wrapping Irrlicht (unresolved external symbol)

This topic is 2833 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

I am attempting to wrap portions of Irrlicht that will be used in my game. However I've come across a problem. Here is the VS2010 error that I am receiving:

Error 1 error LNK2019: unresolved external symbol __imp__createDevice referenced in function "public: void __thiscall irrInterfacer::initializeIrrlicht(enum irr::video::E_DRIVER_TYPE,wchar_t const *,class irr::core::dimension2d<unsigned int> const &,bool,bool,bool)" (?initializeIrrlicht@irrInterfacer@@QAEXW4E_DRIVER_TYPE@video@irr@@PB_WABV?$dimension2d@I@core@4@_N33@Z) C:\Users\Steven\Documents\Visual Studio 2010\Projects\Novus\Novus\irrInterfacer.obj Novus

Here is my code for irrInterfacer::initializeIrrlicht()


//From irrInterfacer.h
void initializeIrrlicht(irr::video::E_DRIVER_TYPE driverType, const wchar_t* windowCaption, const irr::core::dimension2d<irr::u32>& windowSize, bool FS, bool SB, bool VS);

//From irrInterfacer.cpp
void irrInterfacer::initializeIrrlicht(irr::video::E_DRIVER_TYPE driverType, const wchar_t* windowCaption, const irr::core::dimension2d<irr::u32>& windowSize, bool FS, bool SB, bool VS)
{
//Create Device
device = irr::createDevice(driverType, windowSize, 32, FS, SB, VS, 0);
//Set Window Caption
device->setWindowCaption(windowCaption);
//Load Driver
driver = device->getVideoDriver();
//Get Scene Manager
smgr = device->getSceneManager();
//Get GUIEnvironment
guienv = device->getGUIEnvironment();
}




Any help would be greatly appreciated!

Thanks,
-Rev

[Edited by - RevBlueJeans on October 17, 2010 12:26:29 AM]

Share this post


Link to post
Share on other sites
Advertisement
Thanks adam! That worked. I created this project a couple days ago and I thought I had already linked the library. It compiles now with no errors. However, I am still having a problem. When I try to run the .exe it crashes. I used the debugger in VS and narrowed it down and found out that it's crashing on a particular line. It's crashing when I try to create and initialize my irrInterfacer interfacer object. I will post the code of from my irrInterfacer.h, irrInterfacer.cpp and main.cpp that pertains to the function. If you see what I'm doing wrong please correct me. I'm no expert on pointers and objects so I could be approaching this from a completely wrong direction!

main.cpp (This is where the program is hanging up at)

irrInterfacer *interfacer;
interfacer->initializeIrrlicht(irr::video::EDT_DIRECT3D9, L"Novus Test One",
irr::core::dimension2d<irr::u32>(800, 600), false, false, false);



irrInterfacer.h

void initializeIrrlicht(irr::video::E_DRIVER_TYPE driverType, const wchar_t* windowCaption, const irr::core::dimension2d<irr::u32>& windowSize, bool FS,
bool SB, bool VS);



irrInterfacer.cpp

void irrInterfacer::initializeIrrlicht(irr::video::E_DRIVER_TYPE driverType, const wchar_t* windowCaption, const irr::core::dimension2d<irr::u32>& windowSize, bool FS, bool SB, bool VS)
{
//Create Device
device = irr::createDevice(driverType, windowSize, 32, FS, SB, VS, 0);
//Set Window Caption
device->setWindowCaption(windowCaption);
//Load Driver
driver = device->getVideoDriver();
//Get Scene Manager
smgr = device->getSceneManager();
//Get GUIEnvironment
guienv = device->getGUIEnvironment();
}




Thanks!

Share this post


Link to post
Share on other sites
This one is easy and goes back to basic c++.

irrInterfacer *interfacer; declares a pointer to an irrInterfacer. However that doesn't instantiate it or create it. So the next line you are telling it to run a function on memory the computer owns. You need to:
a) use irrInterfacer interfacer; to create an instance or
b) use irrInterfacer* interfacer = new irrInterfacer(); to create a new instance, and then neat the end of your could use delete interface;

Share this post


Link to post
Share on other sites
Thanks Adam! That did the trick :). I was on the verge of scrapping this and just building the game ontop of Irrlicht without the wrapper, but now I can continue working!

Share this post


Link to post
Share on other sites
Glad to hear it helped. I myself am working with irrlicht right now to create a game. I haven't created a wrapper more so a general game class that calls all my irrlicht engine stuff. This way I can leave my main.cpp and main loop clear and clutter free.

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!