Aram Havarneanu <aram.h@xxxxxx> writes: > /usr/local/lib/gcc/pdp11-bsd2.11/4.1.2/libgcc.a(__main.o):__main.o:(.text+0x86): > undefined reference to `_atexit' > collect2: ld returned 1 exit status On non-ELF systems, gcc will cause the main function to invoke a function named __main. That function will use atexit to arrange to run global destructors at program exit time. If you don't care about global destructors, then provide a dummy version of the standard atexit function. Some BSD libraries provide on_exit rather than atexit, in which case your atexit function can simply call on_exit. Ian