I am not sure if I did a right thing by starting a new topic. But then a forum search on “C++ support” returns nothing. Google seems to return better results than the forum search (nowadays after the new forum look n feel). Hence.
Also, I invite NVIDIA employees to post their suggestions as well.
When you include STL headers (like #include, #include etc.) on .cu files, you may get variety of compile errors, warnings and linker errors.
Here in, I am listing out a few things that I faced and how I solved them. Hopefully some1 finds this worthwhile.
Ever faced compilation problems like:
"
Error 1 internal error: assertion failed at: "D:/Bld/rel/gpgpu/toolkit/r2.0/compiler/edg/EDG_3.9/src/lower_name.c",
line 4179 C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\xutility 870
"
This is a crazy error because the “D:/Bld…” directory never exists in first place. Compilation errors on non-existent files can piss any1 off.
This can be solved by installing VS 2005 SP1. The SP1 is freely downloadable. Just google it out.
The path has “…gpgpu/toolkit…” thing. How it is related to VS2005 SP1?? – I have no clue. Most likely that some NVCC problem is hiding there.
Thinking of it – The …gpgpu/toolkit… path actually stands for the source-file of the CUDAFE compiler itself. The guy who developed cudafe has stored the sources somewhere in D:/Bld… whatever. Hence.
But some how VS2005 SP1 does a magic there.
Facing linker errors that say "LNKxxxx: Symbol already defined…"?
When you use C++ constructs and STL in .cu files, you need to make sure that you pass proper “XCompiler[i][/i]” options to NVCC so that these options are passed to “cl”. The options that you should pass can be extracted from the project property pages corresponding to the build configuration (debug/release). Just copy,paste them (from the advanced-commandline section) and pass them to “Xcompiler” option of NVCC.
The only exception is “Dont pass the /TP or /TC” option. This is taken care by NVCC itself.
I still sometimes face the first problem at times when I write bad code (that anyway is not destined to compile).