LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-26-2005, 07:30 PM   #1
ajk48n
Member
 
Registered: Jun 2005
Posts: 34

Rep: Reputation: 15
GLU compile problems


I'm having a problem with my OpenGL libraries. When I try to compile something that uses libGLU.a, I got a huge amount of errors, that say

undefined reference to `glEnable'

along with every other opengl function called.

I have a Quadro card, and am using the NVIDIA drivers. I'm pretty sure that the compiler is seeing the correct libraries, and during linking the -lglu option is being used.

Anyone have any ideas?
 
Old 07-26-2005, 07:43 PM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Did you try -L/usr/X11R6/lib -lGLU -lGL ?

Last edited by keefaz; 07-26-2005 at 07:46 PM.
 
Old 07-27-2005, 02:02 PM   #3
ajk48n
Member
 
Registered: Jun 2005
Posts: 34

Original Poster
Rep: Reputation: 15
Yeah, I tried that. Same problem. If it helps, the problem is happening during linking, not compilation.
 
Old 07-28-2005, 05:10 AM   #4
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Post your Makefile or your complete commands sequence
 
Old 02-24-2006, 11:25 PM   #5
beanerjo
Member
 
Registered: Aug 2004
Location: New Zealand
Distribution: Slackware
Posts: 40

Rep: Reputation: 15
At first I opened a new thread, but just found this one. So here I am posting what I wrote. (I am going to close the new thread.)

--

I have Slackware 10.2 installed on my Dell laptop with X upgraded to Xorg6.9.0 (from slackware-current). I upgraded X because the "Intel 915GM" wasn't supported by the old version.

Now I tried compiling stellarium 0.7.1 from source. Configure complained that GLU (which is included in Xorg6.9.0, located in /usr/X11R6/lib) is not installed, and stopped. I installed MesaLib 6.4.2 to /usr/local/lib and the same thing happened.

So I forced ./configure (of stellarium-0.7.1) to skip checking the GLU part, and modified src/Makefile (of stellarium-0.7.1) so -lGLU is included in LIBS.

The compilation was okay but at the final step I got a linking error *even though* -lGLU was there.

The error message was that some glu... functions are not found, which were actually found in the result of "nm /usr/X11R6/lib/libGLU.so".

So I added -L/usr/local/lib (which contains my new libGLU.so from the new MesaLib) before -L/usr/X11R6/lib, and I got everything perfect. This means, I think, that the libGLU in the MesaLib worked but the libGLU in Xorg6.9.0 didn't.

I don't know why /usr/X11R6/lib/libGLU.so (coming with Xorg6.9.0) failed. Perhaps it is related with SDL (which is required for stellarium). Or perhaps because I upgraded some libraries from time to time. (I don't remember which.)

This is the part that failed when /usr/X11R6/lib/libGLU.so was used:
------------- begin -----------
g++ -g -O2 -Wall -I/usr/include/SDL -D_REENTRANT -o stellarium main.o ...OTHER_OBJ_FILES_HERE... -lGL -lGLU -lm -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread -lpng -lz -lSDL_mixer
------------- end -------------

Above, without -L/usr/local/lib it fails; with it it is okay. Again, /usr/local/lib has the new MesaLib library files (which I installed from source) including libGLU.so.

I don't know if it is a bug or version mismatch or whatever.

CH
 
Old 02-25-2006, 04:25 AM   #6
jaMslack
LQ Newbie
 
Registered: Jun 2003
Distribution: Slackware current
Posts: 6

Rep: Reputation: 0
try substitute -lGLU with -lglut
 
Old 02-26-2006, 04:28 PM   #7
beanerjo
Member
 
Registered: Aug 2004
Location: New Zealand
Distribution: Slackware
Posts: 40

Rep: Reputation: 15
Thanks, jaMslack. I played with ./configure to change -lGLU to -lglut, and found the reason from a different place. It was libstdc++. My GCC version was 3.3.6 which contains libstdc++.so.5, while /usr/X11R6/lib/libGLU.so (in Xorg6.9.0 in slackware-current) requires libstdc++.so.6.

I upgraded GCC to 3.4.5 (which contains libstdc++.so.6) and everything is working perfectly. (I didn't get the same error when stellarium was compiled against /usr/local/lib/libGLU.so because that libGLU was compiled against libstdc++.so.5.) Now everything makes sense.

CH
 
Old 06-25-2007, 06:17 AM   #8
simopal6
Member
 
Registered: Jun 2006
Location: Italy
Distribution: Slackware 13.1
Posts: 230

Rep: Reputation: 30
Hello! I'm having the same problem.
This is what "./configure" says:
Code:
checking for gluBuild2DMipmaps in -lGLU... no
configure: error: glu required
This is the related config.log section:
Code:
configure:5488: checking for gluBuild2DMipmaps in -lGLU
configure:5523: gcc -o conftest -g -O2   conftest.c -lGLU  -lbz2 -lpng -ljpeg -lz -lsqlite3  >&5
/usr/bin/ld: cannot find -lGLU
collect2: ld returned 1 exit status
configure:5529: $? = 1
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE "xmoto"
| #define VERSION "0.3.0"
| #define _GNU_SOURCE 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define XMOTO_LITTLE_ENDIAN 1
| #define HAVE_SQLITE3_H 1
| #define HAVE_LIBSQLITE3 1
| #define HAVE_LIBZ 1
| #define HAVE_LIBJPEG 1
| #define HAVE_LIBPNG 1
| #define HAVE_LIBBZ2 1
| /* end confdefs.h.  */
|
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char gluBuild2DMipmaps ();
| int
| main ()
| {
| return gluBuild2DMipmaps ();
|   ;
|   return 0;
| }
configure:5547: result: no
configure:5557: error: glu required
libGLU.so and libGLU.a are in /usr/X11R6/lib, and this path is in ld.so.conf.
"ldd libGLU.so" says:
Code:
ldd /usr/X11R6/lib/libGLU.so
        linux-gate.so.1 =>  (0x40000000)
        libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x4008d000)
        libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x4009c000)
        libGL.so.1 => /usr/X11R6/lib/libGL.so.1 (0x40166000)
        libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x40206000)
        libm.so.6 => /lib/libm.so.6 (0x402bd000)
        libc.so.6 => /lib/libc.so.6 (0x402e0000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x403fd000)
        libdl.so.2 => /lib/libdl.so.2 (0x40407000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x4040b000)
        /lib/ld-linux.so.2 (0x80000000)
Now look at this:
Code:
root@simone-nb:/usr/X11R6/lib# gcc -lGLU
/usr/bin/ld: cannot find -lGLU
collect2: ld returned 1 exit status
Code:
root@simone-nb:/usr/X11R6/lib# gcc -L/usr/X11R6/lib -lGLU
/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/../../../crt1.o(.text+0x18): In function `_start':
../sysdeps/i386/elf/start.S:115: undefined reference to `main'
collect2: ld returned 1 exit status
It looks like "ld" doesn't look inside /usr/X11R6/lib...
This is my ld.so.conf:
Code:
/usr/X11R6/lib
/opt/kde/lib
/usr/i486-slackware-linux/lib
/usr/lib/qt/lib
/usr/lib
/usr/local/lib
(by the way, does order matter inside this file?)

Why does this happen?
I'll try and edit "configure" in order to explicitly pass the -L/usr/X11R6/lib argument to gcc, but i would like "ld" to do this automatically..!
Thanks!

(edit: i've set LDFLAGS=/usr/X11R6/lib, and "configure" works)

Last edited by simopal6; 06-25-2007 at 06:21 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
glu.h not found Ankardo Linux - Software 2 10-01-2005 05:10 PM
SGI SI GLU question r350 Programming 0 02-09-2004 08:08 AM
Compile problems looper Linux - Software 11 01-15-2004 08:16 PM
compile problems with 2.4.18 Syncrm Slackware 7 09-16-2002 04:29 AM
compile problems zenerdiode Linux - Software 2 12-22-2000 11:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration