Menu

#12 building libosmscout-map-agg fails

main
accepted
None
5
2016-04-06
2015-09-01
knowname
No

i installed the following dependencies:

  • libagg-dev
  • libfreetype6-dev

but libosmscout-map-agg fails with:

make[1]: Entering directory /home/vagrant/libosmscout/libosmscout-map-agg/src' CXXLD libosmscoutmapagg.la /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libaggfontfreetype.a(libaggfontfreetype_la-agg_font_freetype.o): relocation R_X86_64_32S against.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libaggfontfreetype.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[1]: *** [libosmscoutmapagg.la] Error 1
make[1]: Leaving directory `/home/vagrant/libosmscout/libosmscout-map-agg/src'
make: *** [all-recursive] Error 1

any idea how i can solve this without manually rebuilding libfreetype6-dev ?

Discussion

  • Tim Teulings

    Tim Teulings - 2015-09-01
    • status: open --> accepted
    • assigned_to: Tim Teulings
     
  • Tim Teulings

    Tim Teulings - 2015-09-01

    I fear I cannot help you. This could be a distribution depending build problem. I remeber under Debian there was an additional (shared or static) library I had to add to successfully compile (I think it was against freetype).

    Looking at: http://packages.ubuntu.com/trusty/amd64/libagg-dev/filelist

    ...
    /usr/lib/libagg.a
    /usr/lib/libagg_pic.a
    /usr/lib/libaggfontfreetype.a
    /usr/lib/libaggfontfreetype_pic.a
    /usr/lib/libaggplatformX11.a
    /usr/lib/libaggplatformX11_pic.a
    /usr/lib/libaggplatformsdl.a
    /usr/lib/libaggplatformsdl_pic.a
    ...

    Perhaps you have to link against another version of the .a libraries (the _pic.a one?).

     
  • Joachim Gehrung

    Joachim Gehrung - 2015-10-26

    Have the same problem here, on Xubuntu 64bit. Do you remember which lib to install?

     
  • Tim Teulings

    Tim Teulings - 2015-10-27
     
  • Tim Teulings

    Tim Teulings - 2015-10-27

    Looking at the history of the libosmscoutmap-agg/configure.ac file, I found this:

    KG_CHECK_MODULES(LIBFREETYPE, [freetype2],
    HASLIBFREETYPE=true
    [AC_SUBST(LIBFREETYPE_CFLAGS)
    AC_SUBST(LIBFREETYPE_LIBS)
    AC_DEFINE(HAVE_LIB_FREETYPE,1,[libfreetype found])]
    ,
    [HASFREETYPE=false])

    AM_CONDITIONAL(HAVE_LIB_FREETYPE,[test "$HASLIBFREETYPE" = "true"])

    PKG_CHECK_MODULES(LIBAGG, [libagg],
    [if test "$HASLIBFREETYPE" = "true"; then
    LIBAGG_LIBS="-laggfontfreetype_pic $LIBAGG_LIBS"
    fi
    AC_SUBST(LIBAGG_CFLAGS)
    AC_SUBST(LIBAGG_LIBS)]
    )

    I assume that this code worked (for some time) under Debian, which was the distribution I used before Arch Linux. Using a "pic" library, would likely solve the compile/link error above. Which library to use may however depend on our actual distribution, since these libraries seems to be named differently on different systems.

     
  • Tim Teulings

    Tim Teulings - 2016-04-06

    Did my last message help you fixing the problem?

     

Log in to post a comment.