Error since i updated to Irr 1.5

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Mad-Mazda
Posts: 20
Joined: Mon Oct 20, 2008 5:44 am

Error since i updated to Irr 1.5

Post by Mad-Mazda »

Code: Select all

main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class irr::IrrlichtDevice * __cdecl irr::createDevice(enum irr::video::E_DRIVER_TYPE,class irr::core::dimension2d<int> const &,unsigned int,bool,bool,bool,class irr::IEventReceiver *)" (__imp_?createDevice@irr@@YAPAVIrrlichtDevice@1@W4E_DRIVER_TYPE@video@1@ABV?$dimension2d@H@core@1@I_N22PAVIEventReceiver@1@@Z) referenced in function _main
Any idea on whats causing that, it was working fine before i updated to Irrlicht 1.5

[Edit]
Also this is my create device code

Code: Select all

IrrlichtDevice *device = createDevice(video::EDT_DIRECT3D9,core::dimension2d<s32>(1024,640));
Thanks.
Last edited by Mad-Mazda on Sat Jan 10, 2009 4:29 am, edited 2 times in total.
Ion Dune
Posts: 453
Joined: Mon Nov 12, 2007 8:29 pm
Location: California, USA
Contact:

Post by Ion Dune »

Are you sure that your library and include files match up?
Mad-Mazda
Posts: 20
Joined: Mon Oct 20, 2008 5:44 am

Post by Mad-Mazda »

Yea im pretty sure i done that correctly
IrrNoob
Posts: 110
Joined: Sun Nov 16, 2008 8:01 pm
Location: Fort Collins, Us

Post by IrrNoob »

Have you tried looking at the updated tutorials for version 1.5? Maybe this could clear up any problems with compatiblity in your code. I'm not sure just a suggestion.
Ion Dune
Posts: 453
Joined: Mon Nov 12, 2007 8:29 pm
Location: California, USA
Contact:

Post by Ion Dune »

What you're getting is a linker error, saying that it cannot locate the entry point function of irrlicht. What compiler are you using? If its MSVC, do you have this somewhere in your code?

Code: Select all

#pragma comment( lib , "Irrlicht.lib" ) ;
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

I'm almost certain that the first response was correct. You need to be sure that you point the linker to the correct .lib file. If all else fails, try to compile, link, and run one of the example programs using the example project file.

Travis
Mad-Mazda
Posts: 20
Joined: Mon Oct 20, 2008 5:44 am

Post by Mad-Mazda »

I have what Ion Dune said. This is my Whole code.

Code: Select all

#include <irrlicht.h>

using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;

#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
#endif


//Main Irrlicht Application
 int main()
 {
        // start up the engine
        IrrlichtDevice *device = 
			createDevice(video::EDT_DIRECT3D9,core::dimension2d<s32>(1024,640));

        video::IVideoDriver* driver = device->getVideoDriver();
        scene::ISceneManager* scenemgr = device->getSceneManager();

        device->setWindowCaption(L"Hello World!");

        // add a first person shooter style user controlled camera
        scenemgr->addCameraSceneNodeFPS();

        // draw everything
        while(device->run() && driver)
        {
                driver->beginScene(true, true, video::SColor(255,0,0,255));
                scenemgr->drawAll();
                driver->endScene();
        }

        // delete device
        device->drop();
        return 0;
 }

Ion Dune
Posts: 453
Joined: Mon Nov 12, 2007 8:29 pm
Location: California, USA
Contact:

Post by Ion Dune »

The problem doesn't lie in your code, it lies in the compiler settings. The problem is (most likely) that the file which is included by

Code: Select all

#include <irrlicht.h> 
is not from the same version of irrlicht as the library included by

Code: Select all

#pragma comment(lib, "Irrlicht.lib") 
. This is especially likely since you just upgrade from one version to another.

You have to make sure that your library path is from the same as your include path. Also make sure that you don't have any old files haunting your project folders anywhere. Also, try what vitek said and use one of the project/solution files from the SDK download and see that that compiles for you.
Post Reply