Reputation: 156
I am trying to compile something using OpenCL under Cygwin (gcc/g++ 4.7.3-1) on Win8. but it failes, saying, there is no OpenCL, but there is (Nvidia SDK):
/usr/lib/gcc/i686-pc-cygwin/4.7.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lOpenCL
collect2: Fehler: ld returns 1
error: command 'g++' failed with exit status 1
Can someone help, please?
Upvotes: 2
Views: 2236
Reputation:
You probably need to tell gcc where to find the library, in addition to the library name. This can be done with a single command line option this way (using AMD OpenCL as an example):
gcc hello.c "%AMDAPPSDKROOT%/lib/x86_64/"libOpenCL.a
If you use the -l option, you also need to use the -L option to extend the library search path to include the OpenCL directory:
gcc hello.c -L"%AMDAPPSDKROOT%/lib/x86_64/" -lOpenCL
Upvotes: 4