我正在尝试在我的Ubuntu 12.04计算机上为histograms of oriented gradients设置一个名为fastHOG的库。当我尝试编译off-the-shelf fastHOG code时,编译器抱怨它找不到fltk/run.h
。根据{{3}},我需要安装Rahul Ashok's tutorial about fastHOG。该教程说除了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
答案 0 :(得分:1)
您上次的错误似乎表明您缺少xrender
的开发文件。尝试使用apt-get
(可能是sudo apt-get install libxrender-dev
安装them,看看它是否解决了这些问题。
前几个错误同样表明您缺少this library的开发文件。尝试安装libfontconfig1-dev
答案 1 :(得分:1)
有点晚了,但为了完整性而添加了。 FLTK2并不是开箱即用的。
1)需要以下软件包:一旦获得它们,请重新运行configure。可能还有更多,因为我没有在处女系统上尝试过这个。
2)在configure生成之后修改makeinclude(或者修改config.in,但我还没想出怎么做)。
LDLIBS add -lfontconfig -lXrender
GDLIBS add -lfontconfig -lXrender -lfreetype
答案 2 :(得分:0)
有趣 - 似乎FLTK的“足够”成功构建了fastHOG以克服其编译错误。