It's Alessio Placitelli's playground
VC++ 2008 and CUDA (NVIDIA)
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.
| Print article | This entry was posted by Alessio Placitelli on 23 November 2008 at 20:19, and is filed under Development. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
English