Undefined reference to `atexit'
03:38 28 Nov 2012

when compiling C++ project, I got an error for this:

/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/crt1.o: In function `_start':
(.text+0xc): undefined reference to `__libc_csu_fini'
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/crt1.o: In function `_start':
(.text+0x11): undefined reference to `__libc_csu_init'

....: undefined reference to `atexit'
collect2: error: ld returned 1 exit status

this is the code:

std::atexit(myExitFunction);

myExitFunction() has been declared well. Why would it complains about atexit()?

c++ gcc undefined-reference