Error undefined reference to while buildling the project

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.
kavi_skp
Posts: 2
Joined: Thu Oct 08, 2009 6:23 am

Error undefined reference to while buildling the project

Post by kavi_skp »

at the time of bulding the project i m getting a error message as
main.cpp:51: undefined reference to `_imp___ZN3irr12createDeviceENS_5video13E_DRIVER_TYPEERKNS_4core11dimension2dIiEEjbbbPNS_14IEventReceiverE'


the line wer it leads me for the error is:
IrrlichtDevice *device =
createDevice(driverType, core::dimension2d<s32>(640, 480), 16, false);


i m trying really hard but no solution
can someone help me as soon as possible
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Post by Sylence »

You need to link with the irrlicht library.

However this has been asked a million times. Use the search first the next time.
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
kavita_dubey
Posts: 22
Joined: Thu Oct 08, 2009 8:47 am

it still doesnt works

Post by kavita_dubey »

added Irrlicht.a file in path and also set values in env variables
if still it doesnt works out then whts wrong?
kavita_dubey
Posts: 22
Joined: Thu Oct 08, 2009 8:47 am

same problm

Post by kavita_dubey »

i have the similar problm
all dll files and .a files are in path
but stil its nt working
:roll:
kavita_dubey
Posts: 22
Joined: Thu Oct 08, 2009 8:47 am

please fast

Post by kavita_dubey »

plss answer the query
its a bit urgent :cry:
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Post by Sylence »

Only putting them somewhere the linker can find them wont help much. You also have to tell the linker that it should link the files.
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
kavita_dubey
Posts: 22
Joined: Thu Oct 08, 2009 8:47 am

chk this plz

Post by kavita_dubey »

1."C:\irrlicht-1.5.1\lib\Win32-gcc" contains Irrlicht.a i have put that into build path
2. added Irrlivht.dll into project directory
3. added "C:\irrlicht-1.5.1\include" which contains all .h files into directories to be added
4. Set the env variable C:\MinGW\bin;C:\MinGW\libexec\gcc\mingw32\3.4.5 which includes the compiler fr c++

what to do other than that
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Post by Sylence »

If you would tell us which IDE you use I'm sure somebody could tell you how to link the library.
Since you did not do this I would recommend reading the documentation of your IDE how to link other libraries.
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
kavita_dubey
Posts: 22
Joined: Thu Oct 08, 2009 8:47 am

hmm

Post by kavita_dubey »

i m using eclipse IDE for the MinGW C++ compiler
kavita_dubey
Posts: 22
Joined: Thu Oct 08, 2009 8:47 am

problm

Post by kavita_dubey »

I havnt added any SW renderer like OpenGL or Direct3D
is tht the problm?
kavita_dubey
Posts: 22
Joined: Thu Oct 08, 2009 8:47 am

help

Post by kavita_dubey »

Can someone tell me DirectX 9 is good for my project scenario's??
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

I think opengl would probably be better.
multum in parvo
CuteAlien
Admin
Posts: 9928
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Sylence already did give you the solution to the linker problem. You have to add the link-library to your project. Just search your IDE for some menu that allows you to link libraries. And make sure you use the correct version - in your case the one in the Win32-gcc folder.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
zillion42
Posts: 324
Joined: Wed Aug 29, 2007 12:32 am
Location: Hamburg, Germany

Post by zillion42 »

if you would use visual studio (express is free and all you need), it would be a lot easier for you, on osX I only know Xcode and on Linux I only know CodeBlocks... I would say those are the most common IDE's, for quite the majority of people here.
And as CuteAlien already told you, the library you use for running any exe must be the same library that was also used when linking (against the library) the exe at compile time.
So best if you open the irrlicht sdk (svn version) and compile the library (irrlicht.dll/.lib on windows and irllicht.a on a mac) yourself, afterwards compile your exe again and link against the irrlicht library that you previously compiled on your system with same version as the sdk you are using...
Only works that way.
Edit:
Of course you can also just use the stable precompiled non svn version, but make sure you are linking against the same library that was compiled using the includes and src of the sdk that you are actually using.
kavita_dubey
Posts: 22
Joined: Thu Oct 08, 2009 8:47 am

:(

Post by kavita_dubey »

The source/include folder of Irrlicht contains three versions of .sln files
1. Irrlicht7.1.sln
2. Irrlicht8.0.sln
3. Irrlicht9.0.sln
and
4. Irrlicht_mobile6.sln

i have linked the Include folder itself in directories,
now whts the problm
Post Reply