Help compiling Hello World example in Linux

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
kjkrum
Posts: 26
Joined: Wed Oct 29, 2003 5:34 pm

Help compiling Hello World example in Linux

Post by kjkrum »

kevin@aphrodite:/home/kevin/irr/examples/1.HelloWorld
0:$ g++ main.cpp -I../../include/ -L../../lib/Linux/ -o helloworld
/tmp/cctE286F.o(.text+0x3c): In function `main':
: undefined reference to `irr::createDevice(irr::video::EDriverType, irr::core::dimension2d<int> const&, unsigned, bool, bool, irr::IEventReceiver*)'
collect2: ld returned 1 exit status

using RedHat gcc-3.2.2-5

confuzzled... :?
Hundo
Posts: 1
Joined: Mon Oct 27, 2003 11:21 pm
Location: Delaware, USA

Re: Help compiling Hello World example in Linux

Post by Hundo »

kjkrum wrote:kevin@aphrodite:/home/kevin/irr/examples/1.HelloWorld
0:$ g++ main.cpp -I../../include/ -L../../lib/Linux/ -o helloworld
/tmp/cctE286F.o(.text+0x3c): In function `main':
: undefined reference to `irr::createDevice(irr::video::EDriverType, irr::core::dimension2d<int> const&, unsigned, bool, bool, irr::IEventReceiver*)'
collect2: ld returned 1 exit status

using RedHat gcc-3.2.2-5

confuzzled... :?
Looks like you forgot your libraries. Here's a small Makefile example:

Code: Select all

CPP=g++
IRR=/YOURPATH/irr41
IRRLIBS=-L$(IRR)/lib/Linux/ -lz -ljpeg -lIrrlicht -L/usr/X11R6/lib -lGL -lXxf86vm -lXext -lX11 -lz -ljpeg -lIrrlicht
IRRINC=-I $(IRR)/include/
                                                                                     
example: main.cpp
        $(CPP)  $(IRRINC)  client.cpp -o $@ $(IRRLIBS)

[/code]
kjkrum
Posts: 26
Joined: Wed Oct 29, 2003 5:34 pm

thanks

Post by kjkrum »

Thanks. I had to add -lpthread but it worked.

Now that I'm awake, I see a Makefile was included with the source...
Post Reply