building on Solaris 10 runs into conflicting iconv problems

Issue #76 resolved
Former user created an issue

try build libgd on sparc64 (gcc version is 3.4.3) MAKE=gmake CC="gcc -m64" ./configure --prefix=/opt/local CFLAGS="-O2 -fomit-frame-pointer -pipe -m64" --with-png=/usr --with-freetype=/opt/local --with-libiconv-prefix=/opt/local

libiconv-1.14 installed into /opt/local

/bin/bash ../libtool --tag=CC   --mode=compile gcc -m64 -std=gnu99 -DHAVE_CONFIG_H -I.   -I/usr/include/libpng12 -I/opt/local/include/freetype2 -I/opt/local/include    -O2 -fomit-frame-pointer -pipe -m64  -MT gdkanji.lo -MD -MP -MF .deps/gdkanji.Tpo -c -o gdkanji.lo gdkanji.c
libtool: compile:  gcc -m64 -std=gnu99 -DHAVE_CONFIG_H -I. -I/usr/include/libpng12 -I/opt/local/include/freetype2 -I/opt/local/include -O2 -fomit-frame-pointer -pipe -m64 -MT gdkanji.lo -MD -MP -MF .deps/gdkanji.Tpo -c gdkanji.c  -fPIC -DPIC -o .libs/gdkanji.o
gdkanji.c:29:1: warning: "ICONV_CONST" redefined
In file included from gdkanji.c:5:
config.h:96:1: warning: this is the location of the previous definition
gdkanji.c:31: error: conflicting types for 'libiconv'
/opt/local/include/iconv.h:83: error: previous declaration of 'libiconv' was here
gdkanji.c:31: error: conflicting types for 'libiconv'
/opt/local/include/iconv.h:83: error: previous declaration of 'libiconv' was here
gmake[2]: *** [gdkanji.lo] Error 1
gmake[2]: Leaving directory `/export/home/valeriy/modules/libgd-2.1.0-rc2/src'
gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory `/export/home/valeriy/modules/libgd-2.1.0-rc2/src'
gmake: *** [all-recursive] Error 1
-bash-3.2$

Comments (8)

  1. psradm

    can't attach file :( I get 403 forbidden https://bitbucket.org/libgd/gd-libgd/issue-attachment/76/

    see: * http://gnataly.com/src/libgd/config.h * http://gnataly.com/src/libgd/config.log

    also if I try configure with -DHAVE_ICONV in CFLAGS, see what happens

    -bash-3.2$ gmake
    Making all in src
    gmake[1]: Entering directory `/export/home/valeriy/modules/libgd-2.1.0-rc2/src'
    gmake  all-am
    gmake[2]: Entering directory `/export/home/valeriy/modules/libgd-2.1.0-rc2/src'
    /bin/bash ../libtool --tag=CC   --mode=link gcc -m64 -std=gnu99  -DHAVE_ICONV -O2 -fomit-frame-pointer -pipe -m64    -o gdcmpgif gdcmpgif.o libgd.la  -ljpeg -lz -lm  -lpng12 -L/opt/local/lib -lfreetype -lz -lbz2 -lfontconfig   -lfontconfig
    libtool: link: gcc -m64 -std=gnu99 -DHAVE_ICONV -O2 -fomit-frame-pointer -pipe -m64 -o .libs/gdcmpgif gdcmpgif.o  ./.libs/libgd.so -L/opt/local/lib -ljpeg -lm -lpng12 /opt/local/lib/libfreetype.so -lz -lbz2 -lfontconfig -R/opt/local/lib
    Undefined                       first referenced
     symbol                             in file
    libiconv_close                      ./.libs/libgd.so
    libiconv_open                       ./.libs/libgd.so
    libiconv                            ./.libs/libgd.so
    ld: fatal: symbol referencing errors. No output written to .libs/gdcmpgif
    collect2: ld returned 1 exit status
    gmake[2]: *** [gdcmpgif] Error 1
    
  2. Former user Account Deleted

    There's problem that you have conflicting installation of iconv in /usr

    conftest.c:38: error: conflicting types for 'iconv' /usr/include/iconv.h:29: error: previous declaration of 'iconv' was here

    thus the test fails and HAVE_ICONV is not defined.

    I don't have Solaris at hand, so I am unable to help you, but you could try adding -I/opt/local/include to CFLAGS, so it overrides default include path.

  3. psradm

    ok, seems like it successfully has build MAKE=gmake CC="gcc -m64" ./configure --prefix=/opt/local CFLAGS="-I/opt/local/include -DHAVE_ICONV -O2 -fomit-frame-pointer -pipe -m64" --with-png=/usr --with-freetype=/opt/local

    but how we can fix the problem? I mean fix for other solaris users?

  4. Former user Account Deleted

    Uninstall Solaris? :)))

    But really, I would suggest just to document it... there's no sensible way how to solve conflicting libraries installation where one is in the standard location.

  5. Pierre Joye

    Can one of you add a note in the docs/INSTALL file please? Either commit directly or do a PR :-)

  6. Log in to comment