Novice: Compiling Qt with Mesa fails: undefined reference to 'atexit'?

Novice: Compiling Qt with Mesa fails: undefined reference to 'atexit'?

Post by Rubican » Tue, 24 Apr 2001 16:47:18



I'm trying to build a minimalist Linux system with self-compiled
XFree86 4.0.2, Qt 2.3.0, Mesa3.4.1, and KDE 2.1.1, using GCC 2.95.3,
which I also compiled myself. I may be making things unnecessarily
hard for myself by doing this, but I've learned more in the past four
days about this stuff than I did the whole past year I've been using
Linux.
First I built GCC 2.95.3 from RedHat's rpm distribution of the
unofficial GCC 2.96, then removed 2.96. Next I built XFree86, despite
the warnings about GNU ld and as not being supported. I have the
binary distributions anyway if I need them, so I'm not too worried
about X. I compiled and installed Mesa next, putting the libraries
directly into /usr/lib and the headers directly into /usr/include/GL.
When I went to build Qt, the configure script found the right
libraries and such, and the build goes fine up to the tutorials
directory, where the following occurs:

make[4]: Entering directory `/usr/local/qt-2.3.0/tutorial/t1'
g++ -c -I/usr/local/qt/include -pipe -O2 -o main.o main.cpp
g++ -L/usr/local/qt/lib -Wl,-rpath,/usr/local/qt/lib   -o ./t1 main.o
-lqt
/usr/lib/libGLU.so.1: undefined reference to `atexit'
collect2: ld returned 1 exit status
make[4]: *** [t1] Error 1

I know what the atexit function does, but the fact that production
code doesn't compile here means that I have done something wrong, and
I am completely clueless as to where I could have screwed this up.
Could someone pick this error apart for me and explain exactly what ld
is complaining about? Is it not finding libGLU.so.1? I ran ldconfig...
Is atexit supposed to be supplied by another library that never got
compiled? Haven't tried any other builds to see... Or is atexit
actually supplied by libGLU.so.1 and it just got configured wrong when
it was compiled?

 
 
 

1. Undefined reference to 'atexit'

I can't compile KDE app on Mandrake 8.0,Mesa 2.4.2  - "configure" script
fails with "Undefined refrence to 'atexit'" error . Here is a full report
from "config.log" :

configure:5279: checking for Qt
tried NO
configure:5440: rm -rf SunWS_cache; g++ -o conftest -O0 -fexceptions
-fno-check-new -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes
-Wwrite-strings -Wno-long-long -Wnon-virtual-dtor -fno-builtin
-I/usr/lib/qt2/include -I/usr/X11R6/include   -L/usr/lib/qt2/lib
-L/usr/X11R6/lib  conftest.C  -lqt -lpng -lz -lm -ljpeg  -lXext -lX11
-lSM -lICE  1>&5
conftest.C: In function `int main()':
conftest.C:20: warning: unused variable `int magnolia'
conftest.C:15: warning: unused variable `class QStringList * t'
/usr/X11R6/lib/libGLU.so.1: undefined reference to `atexit'
collect2: ld returned 1 exit status
configure: failed program was:
#include "confdefs.h"
#include <qglobal.h>
#include <qapplication.h>
#include <qapp.h>
#include <qobjcoll.h>
#include <qevent.h>
#include <qstring.h>
#include <qstyle.h>
#include <qiconview.h>
#if ! (QT_VERSION >= 222)
#error 1
#endif

int main() {
    QStringList *t = new QStringList();
    QIconView iv(0);
    iv.setWordWrapIconText(false);
    QString s;
    s.setLatin1("Elvis is alive", 14);
    int magnolia = QEvent::Speech; /* new in 2.2 beta2 */
    return 0;

2. LaTex cannot find .sty files -- HELP!!

3. ibc6-2.5.5 suffering with undefined reference to 'atexit' + on debain 2.2 r5

4. chmod all (including dot) files

5. Undefined reference to 'atexit'

6. X and Matrox MGA Millenium 2MB WRAM

7. 2.4: Fix for jbd compiler warnings.

8. ld: undefined reference to 'atexit'

9. undefined reference to `pw_crypt',undefined reference to `spw_unpack'

10. Can't seem to fix `undefined reference to `stat'' and `undefined reference to `atexit''

11. /lib/libc.so.6.1: undefined reference to `atexit'

12. Qt - 'undefined reference'