64-bit linking error

I hate to be yet another person who makes a thread about this, but I can’t figure it out. I have the 64-bit toolkit and SDK and can’t compile because of linking errors. I have tried using Visual Studio 2008 Professional and Eclipse CDT, both getting the same (although differently worded) errors. I am trying to compile the “deviceQuery” project.

Visual Studio:

1>deviceQuery.obj : error LNK2019: unresolved external symbol __imp__cutCheckCmdLineFlag@12 referenced in function _main

1>deviceQuery.obj : error LNK2019: unresolved external symbol _cudaRuntimeGetVersion@4 referenced in function _main

1>deviceQuery.obj : error LNK2019: unresolved external symbol _cudaDriverGetVersion@4 referenced in function _main

1>deviceQuery.obj : error LNK2019: unresolved external symbol _cudaGetDeviceProperties@8 referenced in function _main

1>deviceQuery.obj : error LNK2019: unresolved external symbol _cudaGetDeviceCount@4 referenced in function _main

Eclipse (minGW):

g++ -LC:\Program Files\CUDA SDK\C\common\lib -LC:\Program Files\CUDA\lib64 -oCudaTest.exe src\deviceQuery.o -lcudart -lcuda -lcutil64D

src\deviceQuery.o: In function `main':

C:/Users/pingu/workspace/CudaTest/Debug/../src/deviceQuery.cpp:35: undefined reference to `cudaGetDeviceCount'

C:/Users/pingu/workspace/CudaTest/Debug/../src/deviceQuery.cpp:43: undefined reference to `cudaGetDeviceProperties'

C:/Users/pingu/workspace/CudaTest/Debug/../src/deviceQuery.cpp:57: undefined reference to `cudaDriverGetVersion'

C:/Users/pingu/workspace/CudaTest/Debug/../src/deviceQuery.cpp:59: undefined reference to `cudaRuntimeGetVersion'

C:/Users/pingu/workspace/CudaTest/Debug/../src/deviceQuery.cpp:105: undefined reference to `_imp__cutCheckCmdLineFlag@12'

Both projects link “cudart.lib” and “cutil64D.lib”. The source files are being included properly, but something is going terribly wrong. It looks like the libraries are dynamically linked (the .dll counterparts), but it can’t get past the compilation step.

Thanks for the help!

I had this exact problem and messages when installing today. Under VS2005 the solution for me was changing the platform from Win32 to x64 in Visual Studio. The default when you open the solutions in the SDK for me was Debug->Win32. Once it was Debug->x64 or Release->x64 it worked fine.

I figured out the issue already and it was related to me not installing the 64-bit compiler with Visual Studio.

I have the same issue, and I have the 64-bit VS C++ compiler tools installed. I am running my development environment from Visual Studio 2008 prof. on Vista 32-bit and I am targeting deployment on a series of nVidia QuadroPlex D4 2200 boxes with a 64-bit Windows 2008 server front machine.

Initially I got an error that cutil64D.lib was not found (due to the 32-bit cuda sdk and drivers installed on dev machine), so I had to build the cutil solution as x64 and that worked out fine. I got both cutil64d.lib/dll and cutil64.lib/dll in my sdk lib folder now.

The x64 version of deviceQuery.exe however still fails to build. See this screenshot:

http://screencast.com/t/MjJiZmEzYTgt

Please advice on how to solve this issue.

Best regards,

Michael Schøler