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

Undefined symbols for architecture x86_64: __ZTVNSt3__123__match_any_but_newlineIcEE

pascal_M_
Beginner
365 Views

I have the following c++ code :

 #include <iostream>
 #include <regex>
  #include <string>

  using namespace std;

  int main()
 {
   string input;
   regex rr("((\\+|-)?[[:digit:]]+)(\\.(([[:digit:]]+)?))?((e|E)((\\+|-)?)[[:digit:]]+)?");
   //As long as the input is correct ask for another number
   while(true)
   {
     cout<<"Give me a real number!"<<endl;
     cin>>input;
     if(!cin) break;
     //Exit when the user inputs q
     if(input=="q")
       break;
     if(regex_match(input,rr))
       cout<<"float"<<endl;
     else
     {
       cout<<"Invalid input"<<endl;
     }
   }
 }

that I compile as follow (m_ccompxe_2013_sp1.4.201) :

/opt/intel/bin/icpc -std=c++11 tst_regex.cpp -o tst_regex

Which throws me the following :

Undefined symbols for architecture x86_64:
  "__ZTVNSt3__123__match_any_but_newlineIcEE", referenced from:
      __ZNSt3__111basic_regexIcNS_12regex_traitsIcEEE12__parse_atomIPKcEET_S7_S7_ in icpc01Hn6D.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64

Any idea ?

0 Kudos
2 Replies
Shenghong_G_Intel
365 Views
0 Kudos
Bernard
Valued Contributor I
365 Views

Looks ICE type of error.

It is hard to understand which object's vtable diagnostic message is referencing.

0 Kudos
Reply