With sstream.cpp:
#include <sstream>
#include <string>
#include <iostream>
int main(){
std::stringstream s("ASDF zzzz ASDF");
std::string word;
int count = 0;
while (s >> word)
count++;
std::cout << " Number of words are: " << count << "\n";
}
when run with nvc++ sstream.cpp -std=c++14 && ./a.out
I get:
/tmp/nvc++rMufZxAT2Qig.o: In function `std::basic_streambuf<char, std::char_traits<char> >::~basic_streambuf()':
nvc++jMufB0B5wm3X.ll:(.text+0x754): undefined reference to `operator delete(void*, unsigned long)'
/tmp/nvc++rMufZxAT2Qig.o: In function `std::basic_ios<char, std::char_traits<char> >::~basic_ios()':
nvc++jMufB0B5wm3X.ll:(.text+0x994): undefined reference to `operator delete(void*, unsigned long)'
/tmp/nvc++rMufZxAT2Qig.o: In function `std::basic_ostream<char, std::char_traits<char> >::~basic_ostream()':
nvc++jMufB0B5wm3X.ll:(.text+0xb14): undefined reference to `operator delete(void*, unsigned long)'
/tmp/nvc++rMufZxAT2Qig.o: In function `std::basic_istream<char, std::char_traits<char> >::~basic_istream()':
nvc++jMufB0B5wm3X.ll:(.text+0xc94): undefined reference to `operator delete(void*, unsigned long)'
/tmp/nvc++rMufZxAT2Qig.o: In function `std::basic_iostream<char, std::char_traits<char> >::~basic_iostream()':
nvc++jMufB0B5wm3X.ll:(.text+0xe54): undefined reference to `operator delete(void*, unsigned long)'
/tmp/nvc++rMufZxAT2Qig.o:nvc++jMufB0B5wm3X.ll:(.text+0x1194): more undefined references to `operator delete(void*, unsigned long)' follow
It works fine with -std=c++11
or lower but fails with -std=c++14
or highter.
Note I don’t need to use sstream in gpu offloading I just need it to load my config files.