我正在尝试在Ubuntu 12.04计算机上为histograms of oriented gradients建立一个名为fastHOG的库。当我尝试编译off-the-shelf fastHOG code时,编译器抱怨找不到fltk/run.h
。根据Rahul Ashok's tutorial about fastHOG,我需要安装Fast Light Toolkit (FLTK) 2.0。该教程指出,除2.0以外的FLTK版本均无效。
因此,我正在尝试编译FLTK 2.0(svn co http://svn.easysw.com/public/fltk/fltk/trunk fltk-2.0
)。在make
文件夹中执行fltk-2.0
时,出现类似undefined reference to 'FcInit'
的错误。
关于如何使FLTK 2.0正确编译的任何建议?
这是在Ubuntu 12.04上使用g++ 4.6.3构建FLTK 2.0时得到的完整错误打印输出:
...
Linking fluid2...
../lib/libfltk2.a(Font.o):Font.cxx:function fltk::list_fonts(fltk::Font**&): error: undefined reference to 'FcInit'
../lib/libfltk2.a(Font.o):Font.cxx:function fltk::list_fonts(fltk::Font**&): error: undefined reference to 'FcPatternCreate'
../lib/libfltk2.a(Font.o):Font.cxx:function fltk::list_fonts(fltk::Font**&): error: undefined reference to 'FcObjectSetBuild'
../lib/libfltk2.a(Font.o):Font.cxx:function fltk::list_fonts(fltk::Font**&): error: undefined reference to 'FcFontList'
../lib/libfltk2.a(Font.o):Font.cxx:function fltk::list_fonts(fltk::Font**&): error: undefined reference to 'FcPatternDestroy'
../lib/libfltk2.a(Font.o):Font.cxx:function fltk::list_fonts(fltk::Font**&): error: undefined reference to 'FcPatternGetString'
../lib/libfltk2.a(Font.o):Font.cxx:function fltk::list_fonts(fltk::Font**&): error: undefined reference to 'FcFontSetDestroy'
../lib/libfltk2.a(Font.o):Font.cxx:function fltk::Font::sizes(int*&): error: undefined reference to 'FcPatternGetDouble'
../lib/libfltk2.a(Font.o):Font.cxx:function fltk::Font::sizes(int*&): error: undefined reference to 'FcFontSetDestroy'
../lib/libfltk2.a(Font.o):Font.cxx:function fltk::Font::encodings(char const**&): error: undefined reference to 'FcFontSetDestroy'
../lib/libfltk2.a(Font.o):Font.cxx:function fltk::Font::encodings(char const**&): error: undefined reference to 'FcPatternGetString' ../lib/libfltk2.a(Image.o):Image.cxx:function figure_out_visual(): error: undefined reference to 'XRenderFindStandardFormat'
../lib/libfltk2.a(Image.o):Image.cxx:function fl_xrender_draw_image(unsigned long, fltk::PixelType, fltk::Rectangle const&, fltk::Rectangle const&): error: undefined reference to 'XRenderCreatePicture'
../lib/libfltk2.a(Image.o):Image.cxx:function fl_xrender_draw_image(unsigned long, fltk::PixelType, fltk::Rectangle const&, fltk::Rectangle const&): error: undefined reference to 'XRenderSetPictureFilter'
../lib/libfltk2.a(Image.o):Image.cxx:function fl_xrender_draw_image(unsigned long, fltk::PixelType, fltk::Rectangle const&, fltk::Rectangle const&): error: undefined reference to 'XRenderSetPictureTransform'
../lib/libfltk2.a(Image.o):Image.cxx:function fl_xrender_draw_image(unsigned long, fltk::PixelType, fltk::Rectangle const&, fltk::Rectangle const&): error: undefined reference to 'XRenderComposite'
../lib/libfltk2.a(Image.o):Image.cxx:function fl_xrender_draw_image(unsigned long, fltk::PixelType, fltk::Rectangle const&, fltk::Rectangle const&): error: undefined reference to 'XRenderComposite'
../lib/libfltk2.a(Image.o):Image.cxx:function fl_xrender_draw_image(unsigned long, fltk::PixelType, fltk::Rectangle const&, fltk::Rectangle const&): error: undefined reference to 'XRenderComposite'
../lib/libfltk2.a(Image.o):Image.cxx:function fl_xrender_draw_image(unsigned long, fltk::PixelType, fltk::Rectangle const&, fltk::Rectangle const&): error: undefined reference to 'XRenderFreePicture'
collect2: ld returned 1 exit status
make[1]: *** [fluid2] Error 1
make: *** [all] Error 2
最佳答案
您最近的错误似乎表明您缺少xrender
的开发文件。尝试使用apt-get
(可能是sudo apt-get install libxrender-dev
)安装them,看看它是否可以解决这些问题。
同样,前几个错误表明您缺少this library的开发文件。尝试安装libfontconfig1-dev
关于c++ - 编译Fast Light Toolkit(FLTK)2.0以与fastHOG一起使用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14036485/