简体   繁体   中英

clFFT Library : ./main_exe: symbol lookup error: ./main_exe: undefined symbol: clfftInitSetupData

My GUI code compiles fine but when I click on a button which does some computation, I get the following error :

 ./main_exe: symbol lookup error: ./main_exe: undefined symbol: clfftInitSetupData

I don't understand given that nm -D output :

nm -D /usr/local/lib64/libclFFT.so | grep  clfftInitSetupData
00000000000acfb0 T clfftInitSetupData

So this function clfftInitSetupData should be known by the executable main.exe .

Here is the main part of the Makefile used :

OPENCL        = /opt/AMDAPPSDK-3.0
INC_OPENCL    = -I$(OPENCL)/include
INC_GSL       = -I/usr/include/gsl
INC_CLFFT       = -I/opt/clFFT/src/include
INCPATH       = $(INC_OPENCL) $(INC_GSL) $(INC_CLFFT) -I/usr/share/qt4/mkspecs/linux-g++ -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I.
LINK          = g++
LFLAGS        = -Wl,-O3
LIBS          = -L/usr/local/lib64 -lclFFT -L/usr/lib -lgsl -lgslcblas -lQtGui -lQtCore -lQtOpenGL -lpthread -L$(OPENCL)/lib/x86_64 -lOpenCL -lglut -lGL -lGLEW -lGLU -L/usr/lib -lpng

and ldd on the executable gives :

linux-vdso.so.1 (0x00007ffe3f96b000)
libclFFT.so.2 => /lib/x86_64-linux-gnu/libclFFT.so.2 (0x00007fbd53bbf000)
libgsl.so.23 => /lib/x86_64-linux-gnu/libgsl.so.23 (0x00007fbd53936000)
libgslcblas.so.0 => /lib/x86_64-linux-gnu/libgslcblas.so.0 (0x00007fbd538f5000)
libQtGui.so.4 => /lib/x86_64-linux-gnu/libQtGui.so.4 (0x00007fbd52dc0000)
libQtCore.so.4 => /lib/x86_64-linux-gnu/libQtCore.so.4 (0x00007fbd52ab6000)
libQtOpenGL.so.4 => /lib/x86_64-linux-gnu/libQtOpenGL.so.4 (0x00007fbd529a8000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fbd52987000)
libOpenCL.so.1 => /usr/local/cuda/targets/x86_64-linux/lib/libOpenCL.so.1 (0x00007fbd5277f000)
libglut.so => not found
libGL.so.1 => /lib/x86_64-linux-gnu/libGL.so.1 (0x00007fbd526eb000)
libGLEW.so => not found
libGLU.so.1 => /lib/x86_64-linux-gnu/libGLU.so.1 (0x00007fbd52678000)
libpng12.so.0 => /usr/lib/libpng12.so.0 (0x00007fbd52651000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fbd524cd000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fbd5234a000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fbd52330000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fbd5216f000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fbd52168000)
libfontconfig.so.1 => /lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007fbd52122000)
libaudio.so.2 => /lib/x86_64-linux-gnu/libaudio.so.2 (0x00007fbd51f08000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fbd51de9000)
libpng16.so.16 => /lib/x86_64-linux-gnu/libpng16.so.16 (0x00007fbd51db0000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fbd51b92000)
libfreetype.so.6 => /lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007fbd51ad4000)
libgobject-2.0.so.0 => /lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007fbd51a7e000)
libSM.so.6 => /lib/x86_64-linux-gnu/libSM.so.6 (0x00007fbd51a73000)
libICE.so.6 => /lib/x86_64-linux-gnu/libICE.so.6 (0x00007fbd51856000)
libXrender.so.1 => /lib/x86_64-linux-gnu/libXrender.so.1 (0x00007fbd5164c000)
libXext.so.6 => /lib/x86_64-linux-gnu/libXext.so.6 (0x00007fbd5143a000)
libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007fbd512f7000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fbd512ed000)
/lib64/ld-linux-x86-64.so.2 (0x00007fbd53d6d000)
libGLX.so.0 => /lib/x86_64-linux-gnu/libGLX.so.0 (0x00007fbd512b9000)
libGLdispatch.so.0 => /lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007fbd511fc000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007fbd511bf000)
libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007fbd511b4000)
libXt.so.6 => /lib/x86_64-linux-gnu/libXt.so.6 (0x00007fbd51149000)
libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007fbd50f45000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fbd50ed1000)
libffi.so.6 => /lib/x86_64-linux-gnu/libffi.so.6 (0x00007fbd50ec7000)
libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007fbd50eab000)
libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fbd50e81000)
libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fbd50c7b000)

If someone could see what's wrong. Maybe I take into account 2 similar libraries, I don't know for the moment.

You showed nm output for /usr/local/lib64/ libclFFT.so yet ldd says it found /lib/x86_64-linux-gnu/ libclFFT.so.2.

Set the LD_LIBRARY_PATH environment variable to /usr/local/lib64 when you run main to make sure it looks there first. Alternatively, add it to your /etc/ld.so.conf.d tree (and re-run ldconfig ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM