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

From FreeSpace Wiki
Jump to: navigation, search
(Page Navigation)
m (formatting)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{Page Navigation|
 
{{Page Navigation|
BookName=[[Fs2 open on Linux]]|
+
BookName=[[The fs2_open on Linux Guide]]|
 
CurrentPage=Missing -lGLU compile error|Missing -lGLU compile error|
 
CurrentPage=Missing -lGLU compile error|Missing -lGLU compile error|
 
PrevPage=[[Fs2_open on Linux/SDL: undefined reference to ...|SDL: undefined reference to ...]]|
 
PrevPage=[[Fs2_open on Linux/SDL: undefined reference to ...|SDL: undefined reference to ...]]|
Line 7: Line 7:
 
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:
  
<b>Solution as Root</b>
+
== 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:
 
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:
Line 15: Line 15:
 
After that, you can run make again and it should finish compiling.
 
After that, you can run make again and it should finish compiling.
  
<b>Solution as User</b>
+
== 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.
 
You don't have root access?  Never fear, we can still fix the problem.  It'll just be a tad more difficult.
Line 39: Line 39:
  
 
Then run <tt>make</tt> from the <tt>fs2_open</tt> directory, and watch the magic happen.
 
Then run <tt>make</tt> from the <tt>fs2_open</tt> directory, and watch the magic happen.
 +
 +
[[Category:FreeSpace Open on Linux|IGLU compile error]]

Latest revision as of 07:02, 28 July 2021

« SDL: undefined reference to ... The fs2_open on Linux Guide
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.