Page 1 of 1

unresolved external

Posted: Sat Mar 14, 2009 3:49 pm
by rabehehbahreini
hi.
I have to compile and run irrlicht from C++ builder 6.
when I try to compile helloword example I receive this error :
[Linker Error] Unresolved external 'irr::createDevice(irr::video::E_DRIVER_TYPE, const irr::core::dimension2d<int>&, unsigned int, bool, bool, bool, irr::IEventReceiver *, const char *)' referenced from F:\VISUALIZER\IRRLICHT-1.4\EXAMPLES\01.HELLOWORLD\MAIN.OBJ

How can I fix this error ?

Posted: Sat Mar 14, 2009 4:45 pm
by bitplane
You need to configure your linker settings.
This isn't a problem with Irrlicht, moving to beginners help.

Posted: Sun Mar 15, 2009 5:19 am
by rabehehbahreini
I have changed my linker settings several times but nothing changed

Posted: Sun Mar 15, 2009 5:33 am
by vitek
I'm not certain, but it is quite possible that you're linking the wrong Irrlicht library (you most likely need to link to the .lib file) or you're not linking to the Irrlicht library at all. If that is not the case I'd guess that there is some link incompatibility between the Irrlicht library you're trying to link to and the object code that you've created (not incredibly likely, but I'm not familiar with the Borland compiler).

I know that the dumpbin tool that ships with the Microsoft compiler can be used to get a list of exports from a library and dependencies of an object file. You could use a tool like this to ensure that the object code you've generated is trying to locate the same symbols that are defined in the Irrlicht library.

Travis

Posted: Sun Mar 15, 2009 5:37 am
by rabehehbahreini
I am not a very proffesional programmer , but I can build and run the same .lib file with VC 2008 and every thing is ok.

Posted: Sun Mar 15, 2009 8:53 am
by overburn
it's definitely a linking problem.
did you include the path to irrlicht.lib in the compiler options?
you could try #pragma comment(lib,"Irrlicht.lib") if you haven't already

Posted: Sun Mar 15, 2009 9:08 am
by rabehehbahreini
yes, i included both the .h and .lib files. and the pragma command, still it doesn't work .

Posted: Sun Mar 15, 2009 3:50 pm
by vitek
You don't include a lib file, you link it, but I'm assuming that is just your misuse of the terminology.

If your linker is indeed finding the lib file, but it does not see the exported symbol, then there is some incompatibility between the pre-built Irrlicht library and the generated object code. I believe that the easy way to fix this is to build the Irrlicht library with the Borland compiler, but I don't know how much work that would be considering that it isn't one of the supported configurations.

Travis

Posted: Mon Mar 16, 2009 2:57 am
by rabehehbahreini
you are right. there is incompatibility between lib files in VC and builder.

Posted: Mon Mar 16, 2009 8:14 am
by rabehehbahreini
I don't know the right .def file which is compatible with borland standard.
IMPLIb fails when I attempt to convert .lib file .
Do you know how to convert it ?