Undefined reference to `atexit'

I recently performed mass updates on my system, which included sdl
1.2.2. Only to find I can no longer compile any sdl applications. It
fails when trying to compile the test program, leaving the following
error in the config.log

/usr/X11R6/lib/libXxf86dga.so: undefined reference to `atexit’

Any help at all would be good.

  • Kevin

I recently performed mass updates on my system, which included sdl
1.2.2. Only to find I can no longer compile any sdl applications. It
fails when trying to compile the test program, leaving the following
error in the config.log

/usr/X11R6/lib/libXxf86dga.so: undefined reference to `atexit’

I got that in an upgrade too - it’s an upgrade problem.
AFAIK - libXxf86dga.so is invalid; it’s libXxf86dga.a
the .so won’t run anymore (I moved it out of the way and have been
rebuilding apps that link it sigh)

Good luck! It’s not SDL-related but it -is- an upgrade problem sigh

G’day, eh? :slight_smile:
- TeunisOn Mon, 30 Jul 2001, Kevin Macey wrote:

I had the same thing, but I had it a couple of months ago. As far as I know
atexit is a function provided by stdlib. With this function you can trigger an
other function when the program stops. This is useful for closing files,
setting your screen so you can read it :), and so on.

stdlib.h : extern int atexit (void (*__func) (void)) __THROW;

In my init_window_sdl() I call atexit like this:

atexit(quit_demosys);

I have defined quit_demosys like this:

void quit_demosys( void ) {
SDL_Quit( );
music->stop();
exit( 1 );
};

Hope this helps you,

Daniel.On Mon, Jul 30, 2001 at 05:19:58AM +1200, Kevin Macey wrote:

I recently performed mass updates on my system, which included sdl
1.2.2. Only to find I can no longer compile any sdl applications. It
fails when trying to compile the test program, leaving the following
error in the config.log

/usr/X11R6/lib/libXxf86dga.so: undefined reference to `atexit’


Professor Farnsworth: “He may have ocean madness, but that’s no excuse for
ocean rudeness.”

atexit() is a standard C function which calls something you pass to it upon
"normal program termination". It should be defined in “stdlib.h”.

I hadn’t heard anywhere that this function was to be phased out, so I can
only assume that your upgrade went funny :wink:

I’d recommend making sure that your standard C libraries and headers upgraded
correctly, and that you have the necessary version of Xxf86dga (and other
XFree86 items) for those C libraries.On Tuesday 31 July 2001 01:52am, winterlion wrote:

On Mon, 30 Jul 2001, Kevin Macey wrote:

I recently performed mass updates on my system, which included sdl
1.2.2. Only to find I can no longer compile any sdl applications. It
fails when trying to compile the test program, leaving the following
error in the config.log

/usr/X11R6/lib/libXxf86dga.so: undefined reference to `atexit’

I got that in an upgrade too - it’s an upgrade problem.
AFAIK - libXxf86dga.so is invalid; it’s libXxf86dga.a
the .so won’t run anymore (I moved it out of the way and have been
rebuilding apps that link it sigh)

Good luck! It’s not SDL-related but it -is- an upgrade problem sigh


Sam “Criswell” Hart <@Sam_Hart> AIM, Yahoo!:
Homepage: < http://www.geekcomix.com/snh/ >
PGP Info: < http://www.geekcomix.com/snh/contact/ >
Advogato: < http://advogato.org/person/criswell/ >

atexit() is a standard C function which calls something you pass to it
upon
"normal program termination". It should be defined in “stdlib.h”.

I hadn’t heard anywhere that this function was to be phased out, so I can
only assume that your upgrade went funny :wink:

I’d recommend making sure that your standard C libraries and headers
upgraded
correctly, and that you have the necessary version of Xxf86dga (and other
XFree86 items) for those C libraries.

I had a similar problem when I upgraded glibc…

Try finding out what version of glibc the program is trying to use, and then
make sure the versions match. (recompile X if nessecary).

Nurgle