Author Topic: Linker libraries with Irrlicht (Linux)  (Read 5116 times)

thcrock

  • Guest
Linker libraries with Irrlicht (Linux)
« on: October 28, 2007, 03:24:07 am »
For some reason, I can't get Code Blocks to set the linker libraries correctly.  I'm trying to build an Irrlicht project (and before anyone mentions it, the Irrlicht Project template doesn't work on Linux) which compiles and runs successfully using this command:

g++ -I/opt/irrlicht/include -I/usr/X11R6/include -O3 -ffast-math main.cpp -o helloworld -L/usr/X11R6/lib -L/opt/irrlicht/lib/Linux -lIrrlicht -lGL -lGLU -lXxf86vm -lXext -lX11

Now I'm trying to put all these flags in the Projects -> Build Options -> Compiler Settings -> Other Options, like this:
-I/opt/irrlicht/include
-I/usr/X11R6/include
-O3 -ffast-math
-L/usr/X11R6/lib
-L/opt/irrlicht/lib/Linux
-lIrrlicht
-lGL
-lGLU
-lXxf86vm
-lXext
-lX11

Note:  I'm entering those in the 'Release' build target.  However, Code::Blocks will not recognize any of these settings, and this is the command it outputs:

g++ -L/usr/bin/lib -L/usr/lib  -o bin/Release/testgbread obj/Release/main.o

Obviously this fails to compile.  Why is it not reading my options?  I've tried every Policy - target only, project only, append, prepend - they all do the same thing, not recognizing the settings.  Is this a bug or am I missing something about how it works?


Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Linker libraries with Irrlicht (Linux)
« Reply #1 on: October 28, 2007, 04:42:08 am »
Is this a bug or am I missing something about how it works?
The latter.

Quote
-I/opt/irrlicht/include
-I/usr/X11R6/include
These, minus the -I, go in the Compiler sub-tab of the Search directories tab.

Quote
-O3
This can be found in the Compiler Flags sub-tab of the Compiler Settings tab.

Quote
-ffast-math
This one goes where you have it (the Other options tab).

Quote
-L/usr/X11R6/lib
-L/opt/irrlicht/lib/Linux
These, minus the -L, go in the Linker sub-tab of the Search directories tab.

Quote
-lIrrlicht
-lGL
-lGLU
-lXxf86vm
-lXext
-lX11
These, minus the -l, go in the Link libraries section of the Linker settings tab.

Cheers,
John E. / TDM
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)