Can't link the SmokeQt binding library to Qt-3.0.4-b2/Cygwin

Ralf Habacker kde-cygwin@mail.kde.org
Fri, 21 Feb 2003 21:53:59 +0100


 Hello list,
>
> I'm the maintainer of PerlQt/Smoke bindings to Qt and I'm trying to get them
> up and working under Cygwin...
> I'm now up to the point where the Smoke library (/kdebindings/smoke/qt)
>  builds fine but links incorrectly (it does link, but the resulting library
>  looks wrong), and I would like some advices from a Cygwin wizard...
>
> Here is the link step I tried (slightly modified libtool output):
>
> g++-2 -shared -nostdlib [object files here] -L/usr/X11R6/lib \
> -L/usr/lib/qt3/lib -L/usr/lib -lqt -lpng -lz -lXext -lX11 -lSM -lICE \
> -L/usr/lib/w32api -L/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-10 -lstdc++-2 \
> -lgcc -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 -Wl,-soname\
> -Wl,cygsmokeqt-1.dll -Wl,--enable-auto-import -o .libs/libsmokeqt.dll.a
>
> This step runs fine, but when I try to link the resulting dll.a into another
> library, I get strange errors about redefined symbols...
>
There is a problem with your link line rsp. with you libtool release. Recent
cygwin libtools does not produce such linklines.  See an example below:

g++ -shared -nostdlib


.libs/profiler.o  -lbz2 -L/usr/lib -L/usr/lib/w32api -L/usr/lib/gcc-lib/i686-pc-
cygwin/2.95.3-10 -L/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-10/../../../../i686-pc
-cygwin/lib -lstdc++-2 -lgcc -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 -
lgcc   -o
.libs/cygprofiler-1.dll -Wl,--image-base=0x10000000 -Wl,--out-implib,.libs/libpr
ofiler.dll.a

Creating library file: .libs/libprofiler.dll.a
creating libprofiler.la

> And indeed, it looks like there is a problem :
>
> $ nm libsmokeqt.dll.a | grep __imp___2Qt\$darkYellow
> 	10319618	I	__imp___2Qt$darkYellow
> 	10319618	I	__imp___2Qt$darkYellow
>
> Twice the same symbol, with the same pointer !

This isn't an error, this is a reference, definitions are identified with T for
text symbols or D for data symbols.

> It looks like most auto-imported symbols have this kind of problem...
>
> So, is it a known problem and is there a workaround?
> Am I doing something wrong?
>
You have a problem with your libtool release. Please upgrade to a recent
binutils update.
Additional informations about libtool and cygwin (this is not a qt releated
problem) you can find in the cygwin mailing lists. (See www.cygwin.com )

Additional you may take a look into the qt tutorials source and see how there
are build.

Regards
Ralf