Page 1 of 1

Error since i updated to Irr 1.5

Posted: Sat Jan 10, 2009 4:10 am
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.

Posted: Sat Jan 10, 2009 4:28 am
by Ion Dune
Are you sure that your library and include files match up?

Posted: Sat Jan 10, 2009 4:39 am
by Mad-Mazda
Yea im pretty sure i done that correctly

Posted: Sat Jan 10, 2009 5:01 am
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.

Posted: Sat Jan 10, 2009 5:10 am
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" ) ;

Posted: Sat Jan 10, 2009 11:06 am
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

Posted: Sat Jan 10, 2009 10:26 pm
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;
 }


Posted: Sun Jan 11, 2009 12:38 am
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.