compiling c++ string failed

We recently upgraded to cuda 3.0 beta and a user reported the following compiling error:

$ nvcc

Class type: struct std::__true_type

/usr/lib/gcc/x86_64-redhat-linux/4.3.2/…/…/…/…/include/c++/4.3.2/iostream(77): internal error: turn_class_definition_into_declaration: class def needed

1 catastrophic error detected in the compilation of “/tmp/tmpxft_00006f15_00000000-4_test.cpp1.ii”.

Compilation aborted.

nvcc error : ‘cudafe’ died due to signal 6

#include <cuda/cuda.h>

#include <iostream>

#include <string>

using namespace std;



		cout << "Hello World!\n";

		// Following line causes the problem... commenting it fixes everything!

		string OutputFilename;

		cout << "Goodbye World!\n";

		return EXIT_SUCCESS;


I tested it with cuda 2.2 and it works fine. The user reported it works fine with cuda 2.3 as well.

We are using cuda 3.0 beta in fedora 10, gcc 4.3.2-7. Is there anyway to fix it?


I am experiencing the same problem (but on a non-trivial program).

Me too. CUDA 2.3, Optix, Visual Studio 2008 SP1.

It seems we cannot use the Optix C++ classes from a .cu.

Pls, fix it!

FWIW, I’ve confirmed this bug is fixed in nvcc 3.0 final.

It’s great to hear this is fixed. However the latest nvcc I could find on the NVIDIA website is release 3.0, V0.2.1221, which has this issue. Could you provide a link to a newer version or give an ETA if it’s not yet avaiable?


I’ve run into the same problem as the OP, but there’s no way I can avoid using strings/iostreams in my code. Is there any other work around?

I need the memory debugging features of the new gdb