dimanche 31 mars 2019

How to fix undefined reference to ... in c++

I am trying to compile mathgl with fltk on a linux debian. In the mathgl directory, I do the followin cmd to configure the compilation :

cmake -Wno-dev -D enable-hdf5=on -D enable-jpeg=on -D enable-png=on -D enable-fltk=on -D enable-qt4=on .

and the result is:

...................................

[82%] Linking CXX executable mglview

cd /home/sosroot/MathLib/mathgl/utils && /usr/local/bin/cmake -E cmake_link_script CMakeFiles/mglview.dir/link.txt --verbose=1 /usr/bin/c++ -fopenmp -O3 -DNDEBUG -rdynamic CMakeFiles/mglview.dir/mglview.cpp.o -o mglview -Wl,-rpath,/home/sosroot/MathLib/mathgl/widgets:/home/sosroot/MathLib/mathgl/src:/usr/local/HDF_Group/HDF5/1.10.5/lib: ../widgets/libmgl-fltk.so.7.5.0 /usr/local/lib/libfltk_images.a /usr/local/lib/libfltk_forms.a /usr/local/lib/libfltk_gl.a -lGL /usr/local/lib/libfltk.a -lSM -lICE -lX11 -lXext -lm ../src/libmgl.so.7.5.0 -lGL -lGLU -lpng -lz -ljpeg /usr/local/HDF_Group/HDF5/1.10.5/lib/libhdf5.so.103.1.0 -ldl -pthread -lm

../widgets/libmgl-fltk.so.7.5.0: undefined reference to XftFontOpenXlfd' ../widgets/libmgl-fltk.so.7.5.0: undefined reference toXftListFonts'
......................................................................

../widgets/libmgl-fltk.so.7.5.0: undefined reference to `XRenderComposite'

../widgets/libmgl-fltk.so.7.5.0: undefined reference to `XRenderQueryExtension'

../widgets/libmgl-fltk.so.7.5.0: undefined reference to `XRenderCreatePicture'

collect2: error: ld returned 1 exit status

utils/CMakeFiles/mglview.dir/build.make:104: recipe for target 'utils/mglview' failed

make[2]: *** [utils/mglview] Error 1

make[2]: Leaving directory '/home/sosroot/MathLib/mathgl'

CMakeFiles/Makefile2:1041: recipe for target 'utils/CMakeFiles/mglview.dir/all' failed

make[1]: *** [utils/CMakeFiles/mglview.dir/all] Error 2

make[1]: Leaving directory '/home/sosroot/MathLib/mathgl'

Makefile:132: recipe for target 'all' failed

make: *** [all] Error 2

can some one help me ?

Thank you.

Aucun commentaire:

Enregistrer un commentaire