glib linking problems



Hi,

I use MinGW (gcc 3.2.3) and Cygwin to compile glib-2.2.3 on windows.
Everything compiles, but linking causes some troubles (see below
for the output of make). The problem seem to be missing the missing
linker flags "-liconv -lintl" when the linker is run. As a 
workaround I set the -liconv and -lintl flags in LDFLAGS  before 
running configure:

> export CC='gcc -mcpu=pentium3 -mno-cygwin'
> export CPPFLAGS='-Ic:/MinGW/include -Ic:/GnuWin32/include'
> export CFLAGS=-O2
> export LDFLAGS='-Lc:/MinGW/lib -Lc:/GnuWin32/lib -liconv -lintl' # 
XXX<---
> 
> # ensure, that pkg-config does not use cygwin-stuff:
> PKG_CONFIG_PATH='/cygdrive/c/GnuWin32/lib/pkgconfig'
> 
> ./configure --with-libiconv --disable-static -- prefix=/cygdrive/c/MinGW 
--host=i386-pc-mingw32

I use the -liconv and -lintl in the LDFLAGS, since I expected them
to be passed to libtool. This is the case: The generated Makefile
sets LDFLAGS as expected, which is passed to libtool, the Makefile
does this correctly:

LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o 
$@ 

This works as expected, can be seen in the output of make below. But then
from within libtool, the linker is invoked via gcc, without the linker 
flags. I think the following line is the one of the libtool script that
runs the linker, without the linker flags.

# Commands used to build and install a shared archive.
archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags -o 
\$output_objdir/\$soname \${wl}--image-base=0x10000000 
\${wl}--out-implib,\$lib"

what could be the problem here? What else can I try to get the respective 
flags set for the linker? When I run the linker manually--exactly the same
as done by Makefile/libtool--and then add -liconv and -lintl, the library
links without errors.

Thanks for any hints!
Bernhard


---------------------
the output from make:
---------------------
make[3]: Entering directory `/cygdrive/c/build_gtk/glib-2.2.3/glib'
/bin/bash ../libtool --mode=link gcc -mcpu=pentium3 -mno-cygwin  -O2 
-mms-bitfields -Wall -Lc:/MinGW/lib -Lc:/GnuWin32/lib -liconv -lintl -o 
libglib-2.0.la -rpath /cygdrive/c/MinGW/lib -version-info 200:3:200 
-export-dynamic -no-undefined -export-symbols ./glib.def garray.lo 
gasyncqueue.lo gbacktrace.lo gbsearcharray.lo gcache.lo gcompletion.lo 
gconvert.lo gdataset.lo gdate.lo gdir.lo gerror.lo gfileutils.lo ghash.lo 
ghook.lo giochannel.lo glist.lo gmain.lo gmarkup.lo gmem.lo gmessages.lo 
gnode.lo gpattern.lo gprimes.lo gqsort.lo gqueue.lo grel.lo grand.lo 
gscanner.lo gshell.lo gslist.lo gstrfuncs.lo gstring.lo gthread.lo 
gthreadpool.lo gtimer.lo gtree.lo guniprop.lo gutf8.lo gunibreak.lo 
gunicollate.lo gunidecomp.lo gutils.lo gprintf.lo libcharset/libcharset.la 
trio/libtrio.la giowin32.lo gspawn-win32.lo gwin32.lo glib-win32res.lo 
-liconv -lwsock32  -lintl 

*** Warning: This system can not link to static lib archive 
c:/GnuWin32/lib/libiconv.la.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.

*** Warning: This system can not link to static lib archive 
c:/GnuWin32/lib/libintl.la.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.

*** Warning: This system can not link to static lib archive 
c:/GnuWin32/lib/libiconv.la.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.

*** Warning: This system can not link to static lib archive 
c:/GnuWin32/lib/libintl.la.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.
rm -fr  .libs/libglib-2.0.dll.a
if test "x`/usr/bin/sed 1q ./glib.def`" = xEXPORTS; then cp ./glib.def 
.libs/libglib-2.0-0.dll.def; else echo EXPORTS > 
.libs/libglib-2.0-0.dll.def; cat ./glib.def >> 
.libs/libglib-2.0-0.dll.def; fi
 gcc -mcpu=pentium3 -mno-cygwin -shared .libs/libglib-2.0-0.dll.def 
.libs/garray.o .libs/gasyncqueue.o .libs/gbacktrace.o 
.libs/gbsearcharray.o .libs/gcache.o .libs/gcompletion.o .libs/gconvert.o 
.libs/gdataset.o .libs/gdate.o .libs/gdir.o .libs/gerror.o 
.libs/gfileutils.o .libs/ghash.o .libs/ghook.o .libs/giochannel.o 
.libs/glist.o .libs/gmain.o .libs/gmarkup.o .libs/gmem.o .libs/gmessages.o 
.libs/gnode.o .libs/gpattern.o .libs/gprimes.o .libs/gqsort.o 
.libs/gqueue.o .libs/grel.o .libs/grand.o .libs/gscanner.o .libs/gshell.o 
.libs/gslist.o .libs/gstrfuncs.o .libs/gstring.o .libs/gthread.o 
.libs/gthreadpool.o .libs/gtimer.o .libs/gtree.o .libs/guniprop.o 
.libs/gutf8.o .libs/gunibreak.o .libs/gunicollate.o .libs/gunidecomp.o 
.libs/gutils.o .libs/gprintf.o .libs/giowin32.o .libs/gspawn-win32.o 
.libs/gwin32.o .libs/glib-win32res.o -Wl,--whole-archive 
libcharset/.libs/libcharset.a trio/.libs/libtrio.a -Wl,--no-whole-archive 
-Lc:/MinGW/lib -Lc:/GnuWin32/lib -lwsock32  -mcpu=pentium3 -mno-cygwin 
-mms-bitfields -o .libs/libglib-2.0-0.dll -Wl,--image-base=0x10000000 
-Wl,--out-implib,.libs/libglib-2.0.dll.a
Creating library file: .libs/libglib-2.0.dll.a
.libs/gconvert.o(.text+0x54):gconvert.c: undefined reference to 
`libiconv_open'
.libs/gconvert.o(.text+0x1a5):gconvert.c: undefined reference to 
`libiconv'
.libs/gconvert.o(.text+0x1b5):gconvert.c: undefined reference to 
`libiconv_close'
.libs/gutils.o(.text+0x194e):gutils.c: undefined reference to `dgettext'
.libs/gutils.o(.text+0x1967):gutils.c: undefined reference to 
`bindtextdomain'
.libs/gutils.o(.text+0x197b):gutils.c: undefined reference to 
`bind_textdomain_codeset'
make[3]: *** [libglib-2.0.la] Error 1




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]