Quantcast
Channel: Intel® Software - Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1175

ICC fails in link but G++ can link

$
0
0

Simple hello world program(bottom of post) when I try to compile & link using ICC:

hmbp:nnCPPProf hima$ icpc -o test test.cpp 
Undefined symbols for architecture x86_64:
  "__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1Emc", referenced from:
      _main in icpcIBtuRJ.o
ld: symbol(s) not found for architecture x86_64

but g++ can do it:

hmbp:nnCPPProf hima$ g++ -o test test.cpp 
hmbp:nnCPPProf hima$ ./test 
Hello World.

 

The program:

hmbp:nnCPPProf hima$ cat test.cpp 
#include <iostream>
using namespace std;
int main(int argc, const char* argv[])
{
  cout<<"Hello World."<<endl;
  return 0;
}
hmbp:nnCPPProf hima$ 

 

I am missing some kind of setup but I ran the setup script suggested by the installer and still no difference.

TCE Open Date: 

Wednesday, November 27, 2019 - 01:33

Viewing all articles
Browse latest Browse all 1175

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>