How to combine CUDA with a MFC app?

i’m using VS.net2005 and how can i deal with the settings so that i can use CUDA in MFC apps.THX!
Please send me a blank example package at t65602466@sogou.com THX!

No answers?Thx

Look at the cppIntegration sample in the SDK. Search the forums for more information, it has been discussed in detail. If you have a specific question about some aspect of integrating CUDA into a C++ application, I’d be happy to help.

Excuse me but the cppIntegration sample isn’t a mfc application.

Hey buddy from TJU,

yes cppIntegration is not a MFC application, but to integrate CUDA with MFC works exactly like the way in cppIntegraiton.

simply make the CUDA function a extern C function, which you can call from your MFC code, just like calling some C functions from a CPP application

hope it helps, and happy birthday to ur TJU ^_^

Yes i know but when i really combine CUDA with MFC in that way it does not work and i think it must be the settings because even a simple normal sentence will make tens of mistakes.

I’m combining a D3D project with CUDA in this way and it works fine.

What are the error messages u get?

it shows a lot of gramma errors and linking errors even pointing to cuda system files. but i’ve checked for many times so i think i should be the settings that make the mistake and when i remove the MFC it works well.

Can you post out those error messages?

Firstly, you should make sure the ctuil32.dll (or ctuil32D.dll if u r using debug mode) can be properly located by your program. Secondly don’t forget to include cudart.lib and cutil32.lib in the Project Properties -> Linker -> Input -> Additional Dependencies.

I’d suggest you copy the dll file into your local project folder, ctuil32.dll in Release folder and cutil32D.dll in Debug folder, to see whether it can rule out thoese linking errors.

I start the MFC in one of the CUDA examples and copy the files just like the examples but it makes mistakes everywhere.
I’m sorry i have no access to that computer right now and in my memory it shows a lot of " missing ‘;’ before ‘type’ " even in cuda header files. So I have to write a console app instead.