Skip to main content
gamedev.net
🔒 Locked

Help with compiling application under Linux.

Started by AsOne 3 replies 650+ views
Original Post
AsOne
AsOne
Hey everyone, so I just installed linux for the first time. I installed the Ubuntu distro and thankfully I'm having no hardware problems (on laptop too!). After getting used to the file system and how to install stuff correctly I began to set up all of my development stuff. Now I'm trying to build an application that runs off the irrlicht engine, when I try and build the application (from eclipse) I get a bunch of errors during linking that point me to an object file from irrlicht either telling me it has an undefined reference to XSomething or glSomething. Does this mean I don't have these libraries installed or I don't have something set up correctly? I looked for OpenGL libraries in the package manager app but what I thought I would need (libgl1-mesa) I already have installed (maybe I need libgl1-mesa-dev?). But then what about the XSomething stuff? What am I missing here? Thanks for any help!
Limitz
Limitz
Quote:
Original post by AsOne
Hey everyone,
so I just installed linux for the first time. I installed the Ubuntu distro and thankfully I'm having no hardware problems (on laptop too!). After getting used to the file system and how to install stuff correctly I began to set up all of my development stuff.

Now I'm trying to build an application that runs off the irrlicht engine, when I try and build the application (from eclipse) I get a bunch of errors during linking that point me to an object file from irrlicht either telling me it has an undefined reference to XSomething or glSomething. Does this mean I don't have these libraries installed or I don't have something set up correctly? I looked for OpenGL libraries in the package manager app but what I thought I would need (libgl1-mesa) I already have installed (maybe I need libgl1-mesa-dev?). But then what about the XSomething stuff?

What am I missing here? Thanks for any help!


Maybe you should get the latest linux drivers from your GPU vendor. It probably searches for opengl functions that are newer then opengl1, usually you need version 1.4, 1.5 or 2.0.

Edit: assuming that you did link against your current opengl libs.

Greetings.
haegarr
haegarr
(Don't know especially Ubuntu but SuSE, but I assume them behaving the same here.)

Most likely you have to bind the libGL (and perhaps libGLU if also gluXyz symbols are unresolved; normally found in /usr/X11R6/lib) and the libX11 (also normally found in /usr/X11R6/lib). I assume the actual files being named like libGL.so.some.version and some symbolic links (like libGL.so) exist pointing to it.

EDIT:

At least libX11 must be installed, or else you couldn't run eclipse, since X11 is the basic graphical user interface in which in turn the windowing system runs. However, also X11 consists of a bunch of extra libs, so perhaps irrlicht may also want to bind other X11 libs.

A general tip: If you don't know what lib does export a specific symbol, you may use the nm shell command like so:
cd /usr/X11R6/lib/
nm --dynamic libAnything.so.version.number | grep "symbol-in-question"
(Notice the bar in-between, please.) That command will list all symbols of libAnything.so.version.number and filter those lines that contain the symbol-in-question.

Now, the lines shown up will look like
000266f0 T XWidthOfScreen
where the "T" means that the symbol is defined in the text section. If, on the other hand, the line looks like
000266f0 U XWidthOfScreen
then the symbol is used but undefined here, and you have to look elsewhere for the symbol's definition.

Try
man nm
to find out more about nm, if you wish.
AsOne
AsOne
Woo, I got it to work. It turns out I didn't have the libraries for OpenGL or X11 just the binaries. Thanks for the tips.

Also, I when I first tried linking against the OpenGL and X11 libraries I tried libGL.a, libGLU.a, and libX11.a, however, this didn't work; I had to use libGL.so, libGLU.so, and libX11.so ... what are these .so files?
Drakkcon
Drakkcon
SO stands for "Shared Object"

They're the linux equivalent of .dll files.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.