Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

error LNK2019: unresolved external symbol _atexit

jmerlin
Beginner
1,664 Views
Linking...(Intel C++ Environment)
xilink: executing 'link'
eMain.obj : error LNK2019: unresolved external symbol _atexit referenced in function ___sti__$E@0

There is no '___sti__$E@0' in my project nor is there any reference to an _atexit symbol.

I've commented everything but the WinMain function out and I still get this error... yet I compiled before and it worked fine.
0 Kudos
2 Replies
JenniferJ
Moderator
1,664 Views
"_atexit" is referenced by some functions in libm.lib and libirc.lib.
did you have the lib path set to the lib directory? You said you've commented out everything except WinMain. You may still have the header files with STL definitions.
If you still have the link problem, please send the WinMain.i file to PremierSupport.
Thanks,
Jennifer
0 Kudos
jmerlin
Beginner
1,664 Views
It was caused by a class destructor in a class defined in one of my other .cpp files. I had included libirc.lib and apparently _atexit is used to signal the code within class destructors. I just removed the destructor and it compiled fine.
0 Kudos
Reply