Using qt with cuda

I am trying to use QT for creating an interface for my CUDA project. I use the SDK Makefile in order to compile my CUDA project on one side as a static lib, using the ‘STATIC_LIB’ flag. After that I obtained a .so file that I moved to my qt project folder. After that I’m compiling the qt project with the following command

g++ -o interface .obj/main.o .obj/intefaceQt.o .obj/form1.o .obj/moc_interfaceQt.o .obj/moc_form1.o -L/usr/share/qt3/lib -L/usr/X11R6/lib -L /usr/local/cuda/lib -L…/…/…/lib -L./ -lcutil -lmyLibrary -lGL -lGLEW -lglut -lcudart -lqt-mt -lXext -lX11 -lm -lpthread

In a subfolder inside the cuda project (hence the -L…/…/…/lib line links to the sdk libraries where cutil is), but I get the following error:

tmpxft_0000031a_00000000-11_project.ii:(.text+0x83d): undefined reference to cutGetCmdLineArgumenti' tmpxft_0000031a_00000000-11_project.ii:(.text+0x89a): undefined reference to cutCheckCmdLineFlag’

That are lines corresponding to the CUT_DEVICE_INIT macro.

Now I know these are two methods defined in cutil so I don’t really get what happened there. It works if I cheat (or at least it compiles) and directly pass the object files created by the CUDA compilation to the qt make line though, but I can’t really do that when I distribute my project :P

For the record I tried the solution described in this thread to no avail.

Why are you using CUTIL? You probably shouldn’t be–it’s purely for convenience of the SDK, I wouldn’t say it’s robust enough to use in a real application.

After a skim over my application I guess i’m only really using it for the CUT_DEVICE_INIT macro, which I hadn’t tried to remove before. After removing it and seing that I’m not really breaking anything the problem is solved. Silly me, thanks for the quick reply.