I’ve used the nvcc compiler to generate file1.obj with a host Launch function that calls the global Kernel function.
I’ve added this file1.obj to a Visual Studio project file2. It compiles okay but complains with error LNK2005: main already defined in file2.obj
What I want is for my program file2.exe to call the host Launch function in the separately nvcc compiled file1.obj, which then calls the GPU code Kernel function.
Can I compile CUDA code without an entry point so that the main in my file2.exe is used instead of the one in file1.obj which it currently seems to run? My file2 project adds the cudart.lib but otherwise is not specially set-up for CUDA.
What is the recommended way of linking and then calling CUDA code from another Visual Studio application?
Thanks for any help,