VC++ 2008 and CUDA (NVIDIA)
by Alessio Placitelli on Nov.23, 2008, under Development
Let me guess: you just wrote your new, shining CUDA application to unleash all the horsepower of your GPU and you are getting some compilation errors in Visual Studio. Some really weird errors. Something like:
1>CUDA_myfile.cu_generated.c
1>C:\Programmi\Microsoft Visual Studio 9.0\VC\INCLUDE\vadefs.h(52) : error C2059: syntax error : ‘string’
1>C:\Programmi\Microsoft Visual Studio 9.0\VC\INCLUDE\vadefs.h(61) : error C2059: syntax error : ‘string’
1>c:\cuda\include\vector_types.h(426) : error C2059: syntax error : ‘type’
1>c:\cuda\include\vector_types.h(427) : error C2059: syntax error : ‘type’
1>c:\cuda\include\vector_types.h(428) : error C2054: expected ‘(‘ to follow ‘operator’
1>c:\cuda\include\vector_types.h(428) : error C2059: syntax error : ‘type’
1>c:\cuda\include\vector_types.h(430) : error C2059: syntax error : ‘}’
1>C:\CUDA\bin/../include\cuda_runtime_api.h(79) : error C2059: syntax error : ‘string’
1>C:\Programmi\Microsoft Visual Studio 9.0\VC\INCLUDE\crtdefs.h(485) : error C2059: syntax error : ‘string’
Right? This is your lucky day. After some struggling, I figured out the solution to this weird issue! Simply right click on the file in the “Solution Explorer” then selectd “Properties”. Now choose “Compile as C++ Code (/TP)” in “Configuration Properties->C/C++->Advanced->Compile As” and apply the changes. Compile your project and.. it should work.
-
http://Website Brad
-
Wego_4_ever
-
http://www.a2p.it/ Alessio Placitelli
English