Hey, I compiled Irrlicht using Linux.
But when i compile the 1st example "hello world" i get the following error message:
/home/michael/tmp/ccMHouiR.o: In function `main':
main.cpp:(.text+0x4c): undefined reference to `irr::createDevice(irr::video::E_DRIVER_TYPE, irr::core::dimension2d<int> const&, unsigned int, bool, bool, bool, irr::IEventReceiver*, char const*)'
collect2: ld returned 1 exit status
but the sourcecode is correct! Can anyone help me please?
THX, Heiland
Error Message
Re: Error Message
have you linked it to libIrrlicht.a ?Heiland wrote: main.cpp:(.text+0x4c): undefined reference to `irr::createDevice(irr::video::E_DRIVER_TYPE, irr::core::dimension2d<int> const&, unsigned int, bool, bool, bool, irr::IEventReceiver*, char const*)'
collect2: ld returned 1 exit status
Because it will link your app against irrlicht lib. You did not!
Linking against a library makes symbols from that library known to your app such that it can use them. When using a static lib this also includes copying the needed object files (those which your app is using and all dependent) into your app making it sometimes very large. In fact, linking against a static lib is the same as if you just add all those object files collected into that lib into your compiler command (g++ -o example main.cpp a1.o a2.o a3.o).
Dynamic libs are different in that symbol resolving is deferred until runtime. All symbols from a dynamic lib are just marked to be useable, and they get a relative adress to jump to during runtime when executing or accessing such symbols.
Anyway, you have to link during compilation (well, actually during linking the app, which is automatically done by most compilers, with an external tool, though). So add the correct library search paths with -L/path/to/library and the linking commands with -lnameOfLibrary.
Linking against a library makes symbols from that library known to your app such that it can use them. When using a static lib this also includes copying the needed object files (those which your app is using and all dependent) into your app making it sometimes very large. In fact, linking against a static lib is the same as if you just add all those object files collected into that lib into your compiler command (g++ -o example main.cpp a1.o a2.o a3.o).
Dynamic libs are different in that symbol resolving is deferred until runtime. All symbols from a dynamic lib are just marked to be useable, and they get a relative adress to jump to during runtime when executing or accessing such symbols.
Anyway, you have to link during compilation (well, actually during linking the app, which is automatically done by most compilers, with an external tool, though). So add the correct library search paths with -L/path/to/library and the linking commands with -lnameOfLibrary.
I'm wondering why these people all want to build their own house while just heard it's just putting bricks onto another.
Now, I've started similarly, but I knew how to read good books on this first. I read K&R probably four times until today. And nowadays it's even easier to google for the error message and get thousands of answers. But it seems even simpler to just ask all over again. I hope he learned this lesson now