"atexit" only defined in root
When compliing programs, I get a common error, where the linker fails to resolve "atexit" in any program that uses it:
/tmp/ccityKp3.o(.text+0x1d): In function `main':
: undefined reference to `atexit'
However, every binary that references atexit CAN use it without problem, and if I compile the program as root, it will be able to link successfully.
This is particularly interesting, considering that libc_nonshared.a is in the right place, and /usr/lib/libc.so groups the nonshared static lib with the libc.so in /lib/. Furthermore, regular users and root use the same ld.
Does anyone happen to know why it does not work for regular users? Any help would be greatly appreciated.
Thanks in advance!