Making a DLL using CUDA code?


I have a MFC application that has a link to CUDA source file (.cu) to run CUDA side of the code. It works great. Now I would like to make a DLL for this file so that I can call the CUDA code via DLL in VC++ MFC application that I currently use .cu file (as we don’t want to distribute our CUDA code).

So, I started off by making a DLL project in VC++ (New->Project->Win32->DLL). I created a header file for all the definitions (which are previously defined in .cu file). Included required CUDA headers
#include <cutil_inline.h>
#include <cufft.h>
#include “sharedmem.cuh”

and then defined
texture<Complex, 2, cudaReadModeElementType> texDataIn;
texture<Complex, 2, cudaReadModeElementType> texDataMid;
texture<Complex, 2, cudaReadModeElementType> texDataOut;

when I try to build the solution, it throws out error on the first line of texture above as
error C2143: syntax error : missing ‘;’ before ‘<’

Maybe I am not doing this the correct way, could someone help me with this or guide me to a tutorial or article on how to build a DLL that uses CUDA code for VC++ (VS2008).

The main goal is not to distribute the .cu file along with our application.