Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Andre_S_
Beginner
91 Views

OSX 9 and Xcode 5.0.2 error when using the icpc compiler

I recently  upgraded to OSX9 (Mavericks) as well as Xcode 5.0.2 and have been getting an ``undefined symbols" error (included later) when using composer_xe_2013_sp1.1.103 in Xcode when running the default c++ program. I have followed all the instructions from http://software.intel.com/en-us/node/458938 but with no success and have managed to get Xcode working with previous versions of the icpc compiler before. 

 Interestingly enough there are no errors when creating a c program and using the icc compiler. Furthermore everything works fine from the command line (all programs compile without any errors). I have tried reinstalling composer_xe_2013_sp1.1.103 and messing around with the build rules (as recommended in other forum posts), but to no avail. The problem seems to stem from the interaction of Xcode with the icpc compiler. Any ideas as to what could be going wrong? For reference the error is included below:

 

Undefined symbols for architecture x86_64:

  "__ZNSt8ios_base4InitC1Ev", referenced from:

      ___sti__$E in main.o

  "__ZNSt8ios_base4InitD1Ev", referenced from:

      ___sti__$E in main.o

  "__ZSt4cout", referenced from:

      _main in main.o

  "__ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc", referenced from:

      _main in main.o

ld: symbol(s) not found for architecture x86_64

Command /usr/bin/icpc-14.0 failed with exit code 1

0 Kudos
2 Replies
Denis_B_Intel1
Employee
91 Views

Hi Andre,

Please check if you can see a Build Setting "CLANG_CXX_LIBRARY=libc++" in the User-Defined section when Intel compiler is selected. If it is there, please follow the steps below described in Release Notes (http://software.intel.com/sites/default/files/Release_Notes_C_2013SP1_M_EN_Update1.pdf):

"3.5.2 Creating new project in Xcode 4.6 or above causes hardcoding of –stdlib=libc++ 

A new project created in Xcode 4.6 or above causes the hardcoding of a setting for –stdlib=libc++ even for projects that have the Intel® C++ Compiler toolset added. So setting the Intel® C++ Compiler field for the C++ Standard Library setting to libstdc++ is ineffective because libc++ overrides the setting. To change this, do the following: 
1. Select the project row in the navigator area at the left of the workspace window 
2. In the project editor that appears, select the row that represents the project level of build settings 
3. You should see the C++ Standard Library setting in bold, indicating that it has a custom value in this project 
4. Select that row and press the Delete key to remove the customized value 
5. The C++ Standard Library build property should now have the value Compiler Default 
Note that you may have to follow the above steps before adding the Intel® C++ Compiler toolset to your project build rules."

Regards,
Denis

Andre_S_
Beginner
91 Views

Thank you Denis, that fixed the problem.

Reply