Difference between revisions of "Fs2 open on Linux/Missing -lGLU compile error"

From FreeSpace Wiki
Jump to: navigation, search
(New page: On some Linux distributions (''Slackware'' for instance), compiling fails because a GL related library doesn't have a link in the <tt>/usr/lib</tt> directory. If the compile fails because...)
 
(Page Navigation)
Line 1: Line 1:
 +
{{Page Navigation|
 +
BookName=[[Fs2 open on Linux]]|
 +
CurrentPage=Missing -lGLU compile error|Missing -lGLU compile error|
 +
PrevPage=[[Fs2_open on Linux/SDL: undefined reference to ...|SDL: undefined reference to ...]]|
 +
NextPage=[[Fs2_open on Linux/Common Runtime Errors|Common Runtime Errors]]}}
 +
<p></p>
 
On some Linux distributions (''Slackware'' for instance), compiling fails because a GL related library doesn't have a link in the <tt>/usr/lib</tt> directory.  If the compile fails because it can't find <tt>-lGLU</tt>, here are two ways to fix it:
 
On some Linux distributions (''Slackware'' for instance), compiling fails because a GL related library doesn't have a link in the <tt>/usr/lib</tt> directory.  If the compile fails because it can't find <tt>-lGLU</tt>, here are two ways to fix it:
  

Revision as of 22:16, 3 September 2007

« SDL: undefined reference to ... Fs2 open on Linux
Missing -lGLU compile error
Common Runtime Errors »

On some Linux distributions (Slackware for instance), compiling fails because a GL related library doesn't have a link in the /usr/lib directory. If the compile fails because it can't find -lGLU, here are two ways to fix it:

Solution as Root

If you have root access to the system, you can create a link to the library in question with just a little bit of command line magic. Go to a console and enter:

$ ln -s /usr/X11R6/lib/libGLU.so /usr/lib/libGLU.so

After that, you can run make again and it should finish compiling.

Solution as User

You don't have root access? Never fear, we can still fix the problem. It'll just be a tad more difficult.

Navigate to the fs2_open/code directory and locate a file named Makefile (not Makefile.rm or Makefile.in or Makefile.anything). Open it in your favorite text editor and make the following changes.

Find this line (line 457 in mine):

FS2_LDFLAGS =  -L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread -lGL -lGLU -lopenal \
  -logg -lvorbis -lvorbisfile

And replace it with this:

FS2_LDFLAGS =  -L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread -lGL -lopenal -logg \
  -lvorbis -lvorbisfile -L/usr/X11R6/lib -lGLU 


Also find this one (line 565 in mine):

AM_LDFLAGS =  -g  -L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread -lGL -lGLU -lopenal \ 
  -logg -lvorbis -lvorbisfile

And replace it with this:

AM_LDFLAGS =  -g -L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread -lGL -lopenal -logg \
  -lvorbis -lvorbisfile -L/usr/X11R6/lib -lGLU

Then run make from the fs2_open directory, and watch the magic happen.