安装fltk-1.3.3-source.tar.gz时,出现的错误汇总:
错误一:
sudo tar -xvf fltk-1.3.3-source.tar.gz
cd fltk-1.3.3
sudo ccmake ./
sudo make
安装到22%,报错如下:
….
[ 21%] Building C object png/CMakeFiles/fltk_png.dir/pngread.c.o
[ 21%] Building C object png/CMakeFiles/fltk_png.dir/pngset.c.o
[ 22%] Building C object png/CMakeFiles/fltk_png.dir/pngwio.c.o
Linking C static library ../lib/libfltk_png.a
[ 22%] Built target fltk_png
Scanning dependencies of target fltk
[ 22%] Building CXX object src/CMakeFiles/fltk.dir/Fl.cxx.o
In file included from /install/fltk-1.3.3/FL/Fl.H:30:0,
from /install/fltk-1.3.3/src/Fl.cxx:48:
/install/fltk-1.3.3/FL/fl_utf8.h:62:27: fatal error: X11/Xlocale.h: No such file or directory
compilation terminated.
make[2]: *** [src/CMakeFiles/fltk.dir/Fl.cxx.o] Error 1
make[1]: *** [src/CMakeFiles/fltk.dir/all] Error 2
make: *** [all] Error 2
错误原因:缺少Xlib.h,可以通过命令:apt-file search Xlib.h搜索一下,可知其包含在package libx11-dev中。
解决方法: 安装libx11-dev则可:
sudo apt-get install libx11-dev