Hello, I’ve got trouble compiling anything using C++ strings and CUDA at the same time.
The problem occurs even in programs as simple as:
#include <string>
int main(int argc, char** argv) {
return 0;
}
I’m compiling with:
nv test.cu
(either with -cuda or without it)
I get following errors:
/usr/include/c++/4.3/bits/basic_string.h(2462): error: incomplete type is not allowed
detected during instantiation of "std::basic_istream<_CharT, _Traits> &std::getline(std::basic_istream<_CharT, _Traits> &, std::basic_string<_CharT, _Traits, _Alloc> &) [with _CharT=char, _Traits=std::char_traits<char>, _Alloc=std::allocator<char>]"
/usr/include/c++/4.3/bits/basic_string.h(2462): error: no instance of overloaded function "std::getline" matches the argument list
argument types are: (std::basic_istream<char, std::char_traits<char>>, std::basic_string<char, std::char_traits<char>, std::allocator<char>>, <error-type>)
detected during instantiation of "std::basic_istream<_CharT, _Traits> &std::getline(std::basic_istream<_CharT, _Traits> &, std::basic_string<_CharT, _Traits, _Alloc> &) [with _CharT=char, _Traits=std::char_traits<char>, _Alloc=std::allocator<char>]"
/usr/include/c++/4.3/bits/basic_string.h(2462): error: incomplete type is not allowed
detected during instantiation of "std::basic_istream<_CharT, _Traits> &std::getline(std::basic_istream<_CharT, _Traits> &, std::basic_string<_CharT, _Traits, _Alloc> &) [with _CharT=wchar_t, _Traits=std::char_traits<wchar_t>, _Alloc=std::allocator<wchar_t>]"
/usr/include/c++/4.3/bits/basic_string.h(2462): error: no instance of overloaded function "std::getline" matches the argument list
argument types are: (std::basic_istream<wchar_t, std::char_traits<wchar_t>>, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t>>, <error-type>)
detected during instantiation of "std::basic_istream<_CharT, _Traits> &std::getline(std::basic_istream<_CharT, _Traits> &, std::basic_string<_CharT, _Traits, _Alloc> &) [with _CharT=wchar_t, _Traits=std::char_traits<wchar_t>, _Alloc=std::allocator<wchar_t>]"
4 errors detected in the compilation of "/tmp/tmpxft_00002ba4_00000000-4_test.cpp1.ii".
g++ and nvcc version information:
g++ (Debian 4.3.1-9) 4.3.1
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2007 NVIDIA Corporation
Built on Fri_Nov__7_06:20:13_PST_2008
Cuda compilation tools, release 2.1, V0.2.1221