1

我正在尝试在我的 Ubuntu 12.04 计算机上建立一个名为fastHOG的定向梯度直方图库。当我尝试编译现成的 fastHOG 代码时,编译器抱怨它找不到。根据Rahul Ashok 关于 fastHOG 的教程,我需要安装Fast Light Toolkit (FLTK) 2.0。该教程说 2.0 以外的 FLTK 版本不起作用。fltk/run.h

所以,我正在尝试编译 FLTK 2.0 ( svn co http://svn.easysw.com/public/fltk/fltk/trunk fltk-2.0)。当我makefltk-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
4

3 回答 3

1

您最后的错误似乎表明您缺少xrender. 尝试使用安装它们apt-get可能sudo apt-get install libxrender-dev并查看它是否解决了这些问题。

前几个错误同样表明您缺少此库的开发文件。尝试安装libfontconfig1-dev

于 2012-12-26T06:06:45.380 回答
1

有点晚了,但只是为了完整性而添加。FLTK2 不是开箱即用的。

1) 需要以下软件包:获得它们后,重新运行配置。可能还有更多,因为我没有在处女系统上尝试过。

  • libglu1-台面开发
  • libice-开发
  • libjpeg62-dev
  • libpng12-dev
  • libx11-dev
  • libxcursor-dev
  • libxext-开发
  • libxft-dev
  • libxinerama-dev
  • libxi开发
  • 台面通用开发
  • zlib1g-dev

2)在通过configure生成makeinclude之后修改它(或者修改config.in,但我还没有想出如何做到这一点)。

LDLIBS add -lfontconfig -lXrender
GDLIBS add -lfontconfig -lXrender -lfreetype
于 2014-01-11T13:58:29.813 回答
0

有趣的是——似乎已经成功构建了“足够”的 FLTK,以便 fastHOG 克服其编译错误。

于 2012-12-29T03:10:35.500 回答