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

Undefined basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >

NEDELEC__Francois
5,143 Views

With the latest C++ compiler 2019.5.281, I get a linkage error upon compiling this simple program, 

 

#include <iostream>

int main () {

    std::clog << "C++ version " << __cplusplus << std::endl;

    return 0;

}

 

> icpc -std=c++11 test.cc

Undefined symbols for architecture x86_64:

  "__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1Emc", referenced from:

      _main in icpcjsInXA.o

ld: symbol(s) not found for architecture x86_64

 

 

Mac OSX 10.14.6

icpc (ICC) 19.0.5.281 20190816

 

0 Kudos
14 Replies
Viet_H_Intel
Moderator
5,142 Views

Not sure if it's related to the version on Mac OS you are using. Do you have an older Mac OS version to try?

0 Kudos
NEDELEC__Francois
5,142 Views

I have 10.14.6 installed on all my machines, so I cannot try another system, but my other mac still has the older ICC and it works like a charm:

$ icpc -std=c++11 src/test/test_cxx.cc

$ a.out

C++ version 201183

This is the previous version:

icpc (IC) 19.0.4.233 20190416

Compilation works fine with Apple LLVM version 10.0.1 (clang-1001.0.46.4)

and also fine with g++-9 (Homebrew GCC 9.2.0) 9.2.0

 

Francois

0 Kudos
Viet_H_Intel
Moderator
5,142 Views

You know what is the built date for your 10.14.6 version? It seems to me that you might use the MacOS version which built after the 19.0 update 5 released.

0 Kudos
NEDELEC__Francois
5,142 Views

My system is up to date, (but my hardware is an 2014 MacBook pro)

Version 10.14.6 (18G95)

Supplemental Update, August 26 2019

 

 

0 Kudos
liu__chang
Beginner
5,142 Views

Hello,

I have the same problem. 

The simple source code is:

 

#include <iostream>

int main () {
    
    std::cout<<"Hello World\n";

    return 0;

}

 

I compile it by typing: icpc test.cpp

And the error is: 

 

Undefined symbols for architecture x86_64:

  "__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1Emc", referenced from:

      _main in icpcE3a39K.o

ld: symbol(s) not found for architecture x86_64

 

I have already type: source /opt/intel/bin/compilervars.sh intel64   

But it changes nothing. 

Is this because of the mac version? But it works fine with Xcode after setting up following the instruction provided in: https://software.intel.com/en-us/articles/intel-math-kernel-library-for-mac-os-compiling-and-linking-with-xcode

Please advice.

Best,

Chang

0 Kudos
joshi__himanshu
Beginner
5,142 Views

Were you able to solev your problem? I am seeing the same problem and it works in XCode! But I would rather it works on command line using make.

0 Kudos
NEDELEC__Francois
5,142 Views

No, I was not able to solve the problem.

0 Kudos
Viet_H_Intel
Moderator
5,142 Views

Not sure if it's related to this post https://software.intel.com/en-us/forums/intel-c-compiler/topic/816792 

0 Kudos
NEDELEC__Francois
5,142 Views

Seems risky to update mac osx now. I am running Mojave... 10.14.6

I have not been able to use icc since September

0 Kudos
John_G_8
Beginner
5,142 Views

I put in a ticket to support on this issue. Here is their response. Intel simply seems unable to fix this issue. It has occurred repeatedly over several years as Apple changes Xcode.

Hello,

An update was made to service request on December 11, 2019:

 

 

John, we are sorry to inform you that only Xcode version 9.4, 10.2, 10.3 are supported by Intel® C++ Compiler version 19 for macOS, I would suggest kindly try to install the product with supported Xcode version.

 

Kindly check the below link for more information on System Requirements:

https://software.intel.com/en-us/articles/intel-c-compiler-190-for-macos-release-notes-for-intel-parallel-studio-xe-2019#sysreq

 

Please let me know if you have any other queries regarding the same.

 

Sign in to view and update your request or to get additional information. You can also reply to this email with questions or comments.

 

Regards,

 

Nilendu
Intel Developer Products Support

 

0 Kudos
NEDELEC__Francois
5,142 Views

Thank you for the info, which explains why nothing was happening. I am not even using icc within Xcode, but probably it depends on the toolchain that comes installed with it. I just saw that Xcode was updated today, so I will try this...

0 Kudos
MWind2
New Contributor III
5,141 Views

This likely not going to help at all, but on windows I had to use:

// Controls whether the STL uses "conditional explicit" internally
#ifndef _HAS_CONDITIONAL_EXPLICIT
#if defined(__CUDACC__)
#define _HAS_CONDITIONAL_EXPLICIT 0 // TRANSITION
#elif defined(__INTEL_COMPILER)
#define _HAS_CONDITIONAL_EXPLICIT 0
#elif defined(__EDG__)
#define _HAS_CONDITIONAL_EXPLICIT 1
#elif defined(__clang__)
#define _HAS_CONDITIONAL_EXPLICIT 0 // TRANSITION, Clang 9
#else // vvv C1XX vvv
#define _HAS_CONDITIONAL_EXPLICIT 1
#endif // ^^^ C1XX ^^^
#endif // _HAS_CONDITIONAL_EXPLICIT

 

0 Kudos
John_G_8
Beginner
5,142 Views

I suspect upgrading Xcode won't help, it will just put you even farther from Intel support. What might help is to revert to an older version of Xcode. You can switch back and forth between versions.

0 Kudos
NEDELEC__Francois
5,142 Views

Hello all,

I just installed parallel_studio_xe_2020.0.015 today, and the problem is gone!

icc (ICC) 19.1 20191121

After a few months of interruption, I can reuse ICC again. Yipee!

F

0 Kudos
Reply