cannot compile, undefined reference to `libiconv' in libuemf/uemf_utf.c

Bug #1251951 reported by insaner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
Undecided
Unassigned

Bug Description

I've been trying to compile recent revisions, (which I have not done in a long time) but it seems I can't compile. Compilation fails with (present in a few functions, but I only pasted the last one):

libuemf/libuemf.a(uemf_utf.o): In function `U_Utf16leToUtf8':
/fittybones/tmp/compile/inkscape/inkscape/src/libuemf/uemf_utf.c:383: undefined reference to `libiconv_open'
/fittybones/tmp/compile/inkscape/inkscape/src/libuemf/uemf_utf.c:384: undefined reference to `libiconv'
/fittybones/tmp/compile/inkscape/inkscape/src/libuemf/uemf_utf.c:385: undefined reference to `libiconv_close'
collect2: ld returned 1 exit status
make[3]: *** [inkscape] Error 1
make[3]: Leaving directory `/fittybones/tmp/compile/inkscape/inkscape/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/fittybones/tmp/compile/inkscape/inkscape/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/fittybones/tmp/compile/inkscape/inkscape'
make: *** [all] Error 2

as informed to me by suv, EMF/WNF support was merged in 12488, and trying to compile revision 12582 seems to have the same problem and 12482 compiles and runs fine

it seems nobody else is having this problem compiling inkscape, and all I could find online in regards to what this could be is:

http://stackoverflow.com/questions/13180032/undefined-reference-to-libiconv-close
which directs me to this
http://stackoverflow.com/questions/10000925/opengl-linux-undefined-reference-to-basic-functions

saying that the problem is due to link order, where -liconv needs to go after some other library in the compile command. This page:

http://sourceforge.net/p/minidlna/bugs/97/

suggested I run ./configure like this:

./configure LIBS="-liconv"

which did the trick. However, I don't know what to change to make it work permanently. (I know the configure script gets overwritten by autogen.sh, for example, so just adding a line in there won't fix it.)

 Let me know what I have to do. thanks

---
fedora 15 linux

$ bzr revno
12819

libgcc-4.6.3-2.fc15.i686
gcc-c++-4.6.3-2.fc15.i686
compat-libgcc-296-2.96-143.1.i686
gcc32-3.2.3-6.i386
gcc-4.6.3-2.fc15.i686

automake16-1.6.3-18.fc13.1.noarch
automake-1.11.1-5.fc14.noarch
automake15-1.5-29.fc13.1.noarch
automake14-1.4p6-21.fc15.noarch

gtk3-3.0.12-1.fc15.i686
gtk2-devel-2.24.7-3.fc15.i686
gtk2-2.24.7-3.fc15.i686
gtkmm30-3.0.1-1.fc15.i686
gtkmm24-2.24.0-3.fc15.i686
gtk3-devel-3.0.12-1.fc15.i686
gtk+-devel-1.2.10-71.fc15.i686
gtkmm24-devel-2.24.0-3.fc15.i686
gtkmm30-devel-3.0.1-1.fc15.i686
gtk+-1.2.10-71.fc15.i686

glib-1.2.10-34.fc15.i686
glibmm24-2.28.1-1.fc15.i686
glibc-static-2.14.1-6.i686
glibc-devel-2.14.1-6.i686
glib2-devel-2.28.8-1.fc15.i686
glibc-2.14.1-6.i686
glibmm24-devel-2.28.1-1.fc15.i686
glibc-utils-2.14.1-6.i686
glib-devel-1.2.10-34.fc15.i686
glibc-headers-2.14.1-6.i686
glib2-2.28.8-1.fc15.i686
glibc-common-2.14.1-6.i686

Tags: build
Revision history for this message
Alvin Penner (apenner) wrote :

which rev of devlibs ?

Revision history for this message
su_v (suv-lp) wrote :

@insaner - please provide information about OS/distro, and build environment/setup.

tags: added: build
Changed in inkscape:
status: New → Incomplete
Revision history for this message
insaner (insaner) wrote :

oh whoops, I knew I was forgetting something:

fedora 14 linux

$ bzr revno
12819

Revision history for this message
insaner (insaner) wrote :

sorry, thats fedora 15, not 14

insaner (insaner)
description: updated
su_v (suv-lp)
Changed in inkscape:
status: Incomplete → New
Revision history for this message
Alvin Penner (apenner) wrote :

I don't see the devlibs rev number anywhere, am I missing something?

Revision history for this message
insaner (insaner) wrote :

suv told me that devlibs is a windows thing, but these issues occur on a linux machine. If devlibs means something else, then I don't really know what that is (other than the gcc, glib, etc versions I provided). Let me know how I can provide the needed info to resolve this. thanks

Revision history for this message
Alvin Penner (apenner) wrote :

sorry about that, I didn't realize that devlibs was only for Windows.

Revision history for this message
insaner (insaner) wrote :

found this line in m4/iconv.m4

AC_DEFUN([AM_ICONV_LINK],
[
  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
  dnl those with the standalone portable GNU libiconv installed).
  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles

...

I guess this is what I am running into here, but I have no knowledge of autoconf or any of that, and very limited knowledge of make and configure.. so I don't know how to fix this for my system (without breaking it for someone else's).. can someone perhaps shed some light here?

Revision history for this message
insaner (insaner) wrote :

hi, please try this patch out, especially if you do NOT have this problem (I want to make sure it doesn't break unaffected systems),
or if you are not running on a linux machine (it seems, macos, hpux and aix have similar checks already in place, if I am not mistaken)

thanks

Revision history for this message
jazzynico (jazzynico) wrote :

Patch from comment #9 tested on Crunchbang Waldorf (based on Debian stable), not affected by the bug.
With the patch, Inkscape fails to link with the following error:

-----
...
  CXXLD inkview
  CXXLD inkscape
//usrusr//binbin//ldld:: cannotcannot findfind --liconvliconv

collect2: error: ld returned 1 exit statuscollect2: error: ld returned 1 exit status
...

Revision history for this message
insaner (insaner) wrote :

ok, just for the sake of anyone else running into this same problem, (in trying to compile anything else, not just inkscape).

it seems for me it was caused by some stray:
     /usr/local/include/iconv.h

which included this line:
#define iconv_t libiconv_t

which is what i believe is directly responsible for this.

 I just renamed it to
     /usr/local/include/iconv.h-NO

and inkscape compiles fine now.. no hacking necessary.

where this file came from, I am not sure.. and rpm isn't giving me any clues. Hope that helps someone out there

insaner (insaner)
Changed in inkscape:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.