nvcc -lib (noob question) with eclipse CDT

Hello !

I’m curerntly trying to use a cuda function in a cpp project in Eclipse CDT (using Mingw).

I’ve got a test.cu.
I execute the cmd : nvcc -lib test.cu → It’s given me a test.lib.

I link test.lib in my cpp project but when I try to compile, I got undefined reference errors :
test.lib(T:/temp/tmpxft_000005c8_00000000-13.obj):T:\temp/tmpxft_000:(.text+0x1cb): undefined reference to cudaLaunch@4' test.lib(T:/temp/tmpxft_000005c8_00000000-13.obj):T:\temp/tmpxft_000:(.text+0x1e9): undefined reference to __cudaRegisterFatBinary@4’
test.lib(T:/temp/tmpxft_000005c8_00000000-13.obj):T:\temp/tmpxft_000:(.text+0x212): undefined reference to `__cudaRegisterFunction@36’

I try to add cudart.lib and cutils32 to my libraries path but same errors.

I’m not very used to compilation stuff, so if anyone can help me, it’ll be great :)



I tried a lot of things but I still can’t link my .lib in my eclipse project. I don’t know how to configure CDT and nvcc for that.

However, I tried an alternative : create a cubin file with nvcc and load it in my cpp using cuModuleLoad.
That’s not exactly what I wanted to do but it works !

if sbdy try out (and success) with the same configuration (nvcc -lib / Eclipse / Mingw), let me know ;)

External Image