Hi,
I was trying to add a CUDA kernel call to my C++ program. I did this by following this other post. So I made a header file with a function prototype:
textureSeams.cuh
#pragma once
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include <stdio.h>
namespace TextureSeams {
void removeSeams(void);
}
Then I implemented the function in a CUDA file:
textureSeams.cu
#include "textureSeams.cuh"
__global__ void remove_seams_kernel(void) {
}
namespace TextureSeams {
void removeSeams(void)
{
remove_seams_kernel <<<1,1>>> ();
printf("Hello, I am in CUDA code!");
}
}
Finally, I call the function in my .cpp file as follows:
TextureSeams::removeSeams();
Still, my compiler gives me the following error (in the .obj of my .cpp file):
LNK2001: unresolved external symbol “void __cdecl TextureSeams::removeSeams(void)”(? removeSeams@TextureSeams@@YAXXZ)
I have checked whether $(CUDA_LIB_DIR) was set in my environment variables and have also added it to Properties > Linker > General > Additional Library Directories . Furthermore I added cuda.lib
, cudart.lib
and curand.lib
to Properties > Linker > Input > Additional Dependencies. Am I still missing something or doing something wrong here?