I have the following c++ code :
#include <iostream> #include <regex> #include <string> using namespace std; int main() { string input; regex rr("((\\+|-)?+)(\\.((+)?))?((e|E)((\\+|-)?)+)?"); //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 ?