我正在尝试在Linux debian上使用fltk编译mathgl。 在mathgl目录中,我执行followin cmd来配置编译:
cmake -Wno-dev -D enable-hdf5=on -D enable-jpeg=on -D enable-png=on -D enable-fltk=on -D enable-qt4=on
结果是:
...................................
`[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 to `XftListFonts'
......................................................................
../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`
有人可以帮我吗?
谢谢。
答案 0 :(得分:0)
好像您缺少xwindows库。尝试将以下库添加到链接行
-lX11 -lXi -lXinerama -lXft -lXext -lsupc++ -lfontconfig -lXrender
您可能还需要添加-L来告诉链接器在哪里可以找到库。