Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
Announcements
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.
7781 Discussions

Linker undefined symbols on Mac OS X

meldaproduction
Beginner
226 Views
Hi,

I have nasty problems on Mac OS X, 10.6.3, newest XCode, newest intel compiler. Compilation succeeds, but linking fails on undefined symbols such as "___cxa_get_globals_fast", "___cxa_rethrow", "___cxa_guard_release" etc. followed by gazillion of references. From the names I suspect it is related to exception handling or something like that.

This is the simplified command line batch (I removed defines and directories to 3rd party libraries...):

source /opt/intel/Compiler/11.1/089/bin/iccvars.sh ia32
icc -O3 -axTP -fPIC -shared -static-libgcc -fexceptions -fvisibility=hidden -c /programming/main.cpp -o main.o
icc -static-intel main.o -shared -ldl -lpthread -lzlib -lfreetype -llibpng -lbzip2 -llibflac -lippcore -lippsemerged -lippsmerged -lippvmemerged -lippvmmerged -L/opt/intel/Compiler/11.1/089/Frameworks/ipp/lib -L/opt/intel/Compiler/11.1/089/lib -L/Developer/usr/lib -framework Carbon -framework AudioUnit -framework CoreAudio -framework CoreMIDI -framework CoreServices -framework AudioToolbox -framework IOKit -framework Security -o output.bin


I tried to remove -fPIC and stuff like that (which took hours because ICC is reeeeaally slow), but nothing helped. What should I do? I need to finally make this work...

Regards,
Vojtech

0 Kudos
2 Replies
Quoc-An_L_Intel
Moderator
226 Views

Try using icpc instead of icc. Looks like you are missing the cxa libraries. icc is a driver to compile "C" files and icpc is use to compile "C++" file.

A related thread on Linux is posted here:
http://software.intel.com/en-us/forums/showthread.php?t=56998

BTW, on your command line, -shared is a linux option, it's not valid on Mac. Try using icpc with the option
-dynamiclib.

meldaproduction
Beginner
226 Views
Thank you very much! That helped!
Reply