Been working with SDK/Toolkit 3.2 and MS Express 2008 for a while. Got some stuff working great, especially one using OpenGL to display some processed imagery. Had a glitch when I run it on newer laptops with 4200M chipsets. Wondering if it required the newest SDK/Toolkit versions, so I decided to take the dive and loaded SDK/Toolkit 4.1 along with MS Express 2010 on my home laptop, away from the work environment. Copied .cpp, .cu and .h files over into new template 2010 solution, and found that some things have changed regarding the Open GL (no glut.h for example, freeglut.h, and need to include rendercheckGL.h seperately now). Got the items to compile, but I get linker errors saying it can’t resolve the GL functions. I’ve got freeglut.lib included in the additional dependencies, just like the bilateral filter demo program, and that seems to compile without a hitch.
Here’s the command coming from MS linker from my ‘translated’ program (using the CUDA template project):
/OUT:“…/…/bin/win32/Release//VideoProcessor. exe” /NOLOGO /LIBPATH:“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.1\lib\Win32” /LIBPATH:“C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.1/C/common/lib/Win32” /LIBPATH:“C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.1/shared/lib/Win32” “cudart.lib” “freeglut.lib” “glew32.lib” “cutil32.lib” “shrUtils32.lib” “kernel32.lib” “user32.lib” “gdi32.lib” “winspool.lib” “comdlg32.lib” “advapi32.lib” “shell32.lib” “ole32.lib” “oleaut32.lib” “uuid.lib” “odbc32.lib” “odbccp32.lib” “C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.1\C\common\lib\Win32\cutil32.lib” “C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.1\shared\lib\Win32\shrUtils32.lib” /MANIFEST /ManifestFile:“Win32/Release/VideoProcessor.exe.intermediate. manifest” /ALLOWISOLATION /MANIFESTUAC:“level=‘asInvoker’ uiAccess=‘false’” /PDB:“C:\Users\Matt\Documents\Visual Studio 2010\bin\win32\Release\VideoProcessor.pdb” /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /PGD:“C:\Users\Matt\Documents\Visual Studio 2010\bin\win32\Release\VideoProcessor.pgd” /LTCG /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:QUEUE
Here’s the matching one for the bilateralFilter program (which compiles OK):
/OUT:“…/…/bin/win32/Release//bilateralFilter. exe” /NOLOGO /LIBPATH:“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.1\lib\Win32” /LIBPATH:“…/…/common/lib/Win32” /LIBPATH:“…/…/…/shared/lib/Win32” “cudart.lib” “freeglut.lib” “glew32.lib” “cutil32.lib” “shrUtils32.lib” “kernel32.lib” “user32.lib” “gdi32.lib” “winspool.lib” “comdlg32.lib” “advapi32.lib” “shell32.lib” “ole32.lib” “oleaut32.lib” “uuid.lib” “odbc32.lib” “odbccp32.lib” “C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.1\C\common\lib\Win32\cutil32.lib” “C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.1\shared\lib\Win32\shrUtils32.lib” /MANIFEST /ManifestFile:“Win32/Release/bilateralFilter.exe.intermediate. manifest” /ALLOWISOLATION /MANIFESTUAC:“level=‘asInvoker’ uiAccess=‘false’” /PDB:“C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.1\C\bin\win32\Release\bilateralFilter. pdb” /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /PGD:“C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.1\C\bin\win32\Release\bilateralFilter. pgd” /LTCG /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:QUEUE
Here’s the end of the MS Express Log:
…
1>display.obj : error LNK2001: unresolved external symbol _glutPostRedisplay
1>display.obj : error LNK2001: unresolved external symbol _glutDisplayFunc
1>display.obj : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0
1>main.obj : error LNK2001: unresolved external symbol _glutMainLoop
1>…/…/bin/win32/Release//VideoProcessor. exe : fatal error LNK1120: 33 unresolved externals
The freeglut.lib file is located in C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.1\C\common\lib\Win32 (notice this path included in the library highlighted in orange above). Any ideas as to why this isn’t resolving?
Another question: Anyone tried to use #define’s to switch the __mul24() operators to ‘*’ for compute >=2.0? Could it be done like this?
#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 200
#define IMUL(a, b) (a)*(b)
#else
#define IMUL(a, b) __mul24(a,b)
#endif