I am trying to integrate .C files (not C++) with CUDA, and I have seen the SDK example “cppintegration”
which use the extern “C”, but it doesn’t work for the .C files and shows
error C2059: syntax error : ‘string’
I learned that extern “C” only works for C++, but what if I want to complie .c files instead of .cpp?
Could anybody please help me out?
If you are a relatively new CUDA user, you probably would never have run into the need. Somewhere around version CUDA 2.0 (I think), nvcc started generating C++ mangled names for functions by default thus removing the need to declare them extern “C” in the header file for linking with c++ code compiled by the host compiler.