.cu function call from .c file Linking error encountered

Hello,

I’ve created a project in Microsoft VS 2005 in which there is an “Application.c” file.

There is a .cu file in the project as well. I want that the function of .cu file should be called from the Application.c file, but I’m unable to do that currently.

On building the code, It gives a linking error saying

unresolved external symbol <function name that’s in .cu file> referenced in function main

Some how, I’m not in a position to convert my application in a .cu file… So, by keeping it as .c only, I need to resolve this…

How do I resolve it?

Can I specify LINK ORDER in visual studio? so that I can link .cu file before it links .c file…

I know for sure that posting the same question all around the forum won’t resolve your issue.

You shold check that name of .obj file produced by nvcc.exe from .cu file is passed to linker and that functions you want to use are declared with extern “C”. I’m sure there are some examples in SDK.

Done using extern “C”…

and I posted in only 3 CUDA prog. related threads just to increase the number of view…

neway, thanks for the tip… I solved it using a tip through microsoft forum…