You better do it other way, take cuda sample that you think is most close to your application, verify it compiles and runs, and THEN start adding your files to THAT project.
Thanks for replying. I finally decided to separate my host code from my device code. Now it works fine.
I use directshow to extract frames from my video and it appears that cuda doesn’t like the COM programming. Maybe I’m wrong but that is what occured to me.
try using intel OpenCV library (cvcam sublibrary) for directshow, they have nice wrapping for com and it’s free for commercial usage
don’t mix .cu files and cpp files. Make all your gpgpu stuff in cu-files and directshow in cpp files. Declare extern c gpgpu methods in cu files and access them from cpp area only by declarations.
also have a look at “cpp-integration” sample from SDK
The error comes from including COM root interface IUnknown (in objbase.h) into your project when VS is not installed correctly. I had that error when VS Express installation went bad. Huh nvcc included objbase.h??
Don’t mix cu and cpp files? Could you point out what problem I would have if I mix them together? Because currently I put some method of a class in one cpp file and some other method related to cuda in another cu file, and both are compiled using the FindCUDA cmake script (CUDA_ADD_LIBRARY(someclass_impl.cu someclass_base.cpp)…) At least, so far It works fine for me…so I am wondering what are the potential problems?
The way I got past the problem is by adding includes just before the IID_PPV_ARGS_Helper template that references IUnknown in objbase.h:
// [dino]: added these includes to battle the identifier “IUnknown” is undefined error #include <wtypes.h> #include <unknwn.h>
May not be the most kosher solution, but does it for me for now.
Able to compile all SDK in 32 bit mode on WXP-64, VS 2005 Express, NVIDIA toolkit and SDK for WXP (not the 64 bit version), Windows Platform SDK, DirectX, and glew…
(all but the OpenMP compiler dependent sample code…)
I just installed CUDA 4.0 final release. When compiling my project in VS2010, I ran into the “IUnknown is undefined” problem, this time in Windows SDK 7.0A.