开发者

QtOpenCl "undefined reference" make errors

开发者 https://www.devze.com 2023-01-03 06:37 出处:网络
So I downloaded the ATI Stream SDK. I don\'t have a gpu now so I use the \'-device cpu\' and got the programs/examples in the OpenCl directory working by adding the directory to LD_LIBRARY_PATH etc.

So I downloaded the ATI Stream SDK. I don't have a gpu now so I use the '-device cpu' and got the programs/examples in the OpenCl directory working by adding the directory to LD_LIBRARY_PATH etc.

Now the problem is when installing QtOpenCl.

The configure script gives me:

skkard@skkard-desktop:~/Applications/qt-labs-opencl$ ./configure

This is the QtOpenCL configuration utility.

Qt version ............. 4.6.2
qmake .................. /usr/bin/qmake
OpenCL ................. yes
OpenCL/OpenGL interop .. yes
Extra QMAKE_CXXFLAGS ...
Extra INCLUDEPATH ......
Extra LIBS ............. -lOpenCL

QtOpenCL has been configured.  Run '/usr/bin/make' to build.

Make gives me:

skkard@skkard-desktop:~/Applications/qt-labs-opencl$ make
cd src/ && make -f Makefile 
make[1]: Entering directory `/home/skkard/Applications/qt-labs-opencl/src'
cd opencl/ && make -f Makefile 
make[2]: Entering directory `/home/skkard/Applications/qt-labs-opencl/src/opencl'
make[2]: Nothing to be done for `first'.
make[2]: Leaving directory `/home/skkard/Applications/qt-labs-opencl/src/opencl'
cd openclgl/ && make -f Makefile 
make[2]: Entering directory `/home/skkard/Applications/qt-labs-opencl/src/openclgl'
make[2]: Nothing to be done for `first'.
make[2]: Leaving directory `/home/skkard/Applications/qt-labs-opencl/src/openclgl'
make[1]: Leaving directory `/home/skkard/Applications/qt-labs-opencl/src'
cd examples/ && make -f Makefile 
make[1]: Entering directory `/home/skkard/Applications/qt-labs-opencl/examples'
cd opencl/ && make -f Makefile 
make[2]: Entering directory `/home/skkard/Applications/qt-labs-opencl/examples/opencl'
cd vectoradd/ && make -f Makefile 
make[3]: Entering directory `/home/skkard/Applications/qt-labs-opencl/examples/opencl/vectoradd'
g++  -o vectoradd vectoradd.o qrc_vectoradd.o    -L/usr/lib -L../../../lib -L../../../bin -lQtOpenCL -lQtGui -lQtCore -lpthread 
../../../lib/libQtOpenCL.so: undefined reference to `clBuildProgram'
../../../lib/libQtOpenCL.so: undefined reference to `clSetCommandQueueProperty'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueNDRangeKernel'
../../../lib/libQtOpenCL.so: undefined reference to `clSetKernelArg'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueCopyBufferToImage'
../../../lib/libQtOpenCL.so: undefined reference to `clReleaseMemObject'
../../../lib/libQtOpenCL.so: undefined reference to `clFinish'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueUnmapMemObject'
../../../lib/libQtOpenCL.so: undefined reference to `clGetMemObjectInfo'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueReadImage'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueMarker'
../../../lib/libQtOpenCL.so: undefined reference to `clRetainCommandQueue'
../../../lib/libQtOpenCL.so: undefined reference to `clGetCommandQueueInfo'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueCopyImage'
../../../lib/libQtOpenCL.so: undefined reference to `clReleaseContext'
../../../lib/libQtOpenCL.so: undefined reference to `clRetainMemObject'
../../../lib/libQtOpenCL.so: undefined reference to `clReleaseEvent'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueWriteBuffer'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueCopyBuffer'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueMapImage'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueReadBu开发者_如何学Cffer'
../../../lib/libQtOpenCL.so: undefined reference to `clUnloadCompiler'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueBarrier'
../../../lib/libQtOpenCL.so: undefined reference to `clGetProgramBuildInfo'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueWaitForEvents'
../../../lib/libQtOpenCL.so: undefined reference to `clRetainProgram'
../../../lib/libQtOpenCL.so: undefined reference to `clCreateContext'
../../../lib/libQtOpenCL.so: undefined reference to `clCreateImage3D'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueMapBuffer'
../../../lib/libQtOpenCL.so: undefined reference to `clGetDeviceIDs'
../../../lib/libQtOpenCL.so: undefined reference to `clGetContextInfo'
../../../lib/libQtOpenCL.so: undefined reference to `clGetDeviceInfo'
../../../lib/libQtOpenCL.so: undefined reference to `clReleaseCommandQueue'
../../../lib/libQtOpenCL.so: undefined reference to `clGetSamplerInfo'
../../../lib/libQtOpenCL.so: undefined reference to `clGetPlatformIDs'
../../../lib/libQtOpenCL.so: undefined reference to `clGetSupportedImageFormats'
../../../lib/libQtOpenCL.so: undefined reference to `clGetPlatformInfo'
../../../lib/libQtOpenCL.so: undefined reference to `clWaitForEvents'
../../../lib/libQtOpenCL.so: undefined reference to `clGetEventInfo'
../../../lib/libQtOpenCL.so: undefined reference to `clGetEventProfilingInfo'
../../../lib/libQtOpenCL.so: undefined reference to `clGetImageInfo'
../../../lib/libQtOpenCL.so: undefined reference to `clCreateProgramWithBinary'
../../../lib/libQtOpenCL.so: undefined reference to `clReleaseSampler'
../../../lib/libQtOpenCL.so: undefined reference to `clCreateCommandQueue'
../../../lib/libQtOpenCL.so: undefined reference to `clGetKernelWorkGroupInfo'
../../../lib/libQtOpenCL.so: undefined reference to `clRetainEvent'
../../../lib/libQtOpenCL.so: undefined reference to `clRetainContext'
../../../lib/libQtOpenCL.so: undefined reference to `clCreateSampler'
../../../lib/libQtOpenCL.so: undefined reference to `clReleaseProgram'
../../../lib/libQtOpenCL.so: undefined reference to `clFlush'
../../../lib/libQtOpenCL.so: undefined reference to `clGetProgramInfo'
../../../lib/libQtOpenCL.so: undefined reference to `clCreateKernel'
../../../lib/libQtOpenCL.so: undefined reference to `clRetainKernel'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueWriteImage'
../../../lib/libQtOpenCL.so: undefined reference to `clCreateBuffer'
../../../lib/libQtOpenCL.so: undefined reference to `clCreateKernelsInProgram'
../../../lib/libQtOpenCL.so: undefined reference to `clCreateProgramWithSource'
../../../lib/libQtOpenCL.so: undefined reference to `clReleaseKernel'
../../../lib/libQtOpenCL.so: undefined reference to `clRetainSampler'
../../../lib/libQtOpenCL.so: undefined reference to `clCreateImage2D'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueCopyImageToBuffer'
../../../lib/libQtOpenCL.so: undefined reference to `clGetKernelInfo'
collect2: ld returned 1 exit status
make[3]: *** [vectoradd] Error 1
make[3]: Leaving directory `/home/skkard/Applications/qt-labs-opencl/examples/opencl/vectoradd'
make[2]: *** [sub-vectoradd-make_default] Error 2
make[2]: Leaving directory `/home/skkard/Applications/qt-labs-opencl/examples/opencl'
make[1]: *** [sub-opencl-make_default] Error 2
make[1]: Leaving directory `/home/skkard/Applications/qt-labs-opencl/examples'
make: *** [sub-examples-make_default-ordered] Error 2

Tried it using the '-no-openclgl', but none of the examples etc are compiled.

I'm using ubuntu 10.04 using the Qt which is installed from synaptic.


I'd guess you aren't linking the OpenCL runtime. The QT library is making calls to those functions but they are not, then, defined in another file. You must link in "that" file to solve your problems.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号