I have written a simple "do-nothing" OpenCL application (in C++ but using the C API) on Linux to get some data about OpenCL speed. It compiles fine and runs without error. I don't have a graphics card that supports OpenCL, but I need to test it on a GPU. I'm trying to build the application on my friend's Windows 7 64bit computer using the OpenCL implementation provided with NVIDIA'S CUDA Toolkit.
When I try to link to the OpenCL.lib file in CUDA\x64 I get undefined references for each OpenCL call within the program (using the standard C API). The same thing happens when I link to the O开发者_如何转开发penCL.dll in the system32 directory. If I link to the win32 library that came with the CUDA Toolkit, I don't get errors, but OpenCL cannot acquire a platform. All the undefined references I get when linking have an @20 or @46 or some random number on the end of the symbol name. I'm not familiar enough with Windows development to know how to fix this problem. What could be my problem?
I apoligize for any newbie-ness. Thanks for any answers!
I believe you'll want to use the library that doesn't give link errors. The other errors you're getting are because you're linking mismatched code together. Then focus on trying to determine what your platform identifier should be. I think you were close but gave up too soon
精彩评论