nvcc compile with option -D passing character string to code.

// main.cu
int main() {
return 0;

When I try to build with the command, "nvcc main.cu -D _DEFINE_ME=“value”

On Cuda SDK 5.0 and 5.5, There is no compile error.

But On Cuda SDK 6.5 A Compile error occurs.
main.cu(6): error: identifier “value” is undefined

How can I pass the character string to codes on cuda sdk 6.5?
And Why is this works different?

it works like
#define DEFINE_ME “value” on 5.x
#define DEFINE_ME value on 6.5


nvcc takes the define and passes it to gcc/g++ under the hood, as part of the compile sequence, but it aggressively strips quotation marks from your define string, and reformats the string in this respect. I’m not sure there is a way to work around the stripping of quotation marks.

The problem has been noted elsewhere:


As far as I test, I works well on sdk 5.x.
As txbob says, I found that it strips all quotation marks from define string.
I think nVidia should say about this issue.
Is this a kind of bug?