This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GTK+ externals are unresolved


Yaakov (Cygwin/X) schrieb:
René Berber wrote:
You're wrong, libraries shared or static are dealt the same way by the
compiler which looks for its list of unresolved symbols and doesn't
re-scan libraries when another symbol appears.

Since I apparently didn't make myself clear the last two times, let me say it again. If libfoo is a shared library, and libbar is another shared library that depends on libfoo (and on Cygwin is, by definition, already linked against it), it does NOT matter if you do this:

gcc -o baz.exe baz.o -lbar -lfoo

or this:

gcc -o baz.exe baz.o -lfoo -lbar

Now if we link with -static, then of course it needs to be before -lfoo,
just like baz.o which depends on libbar needs to be before -lbar.

But that's not the case here; all the GNOME libraries are shared, and
pkg-config's order is ultimately correct.

Bottom line: this linking order discussion is a red herring.  My
suspicion is that there is a mixing of the versions provided by the
distro and Ports.

Anyway, it compiles with my fixed order and gives the unresolved symbols with the original $(pkg-config --libs gtk+-2.0) order of libs.
Please try it our yourself.
--
Reini Urban


--- Begin Message --- M.O.D. schrieb:
John Emmas <johne53 <at> tiscali.co.uk> writes:

Perhaps you're missing the file 'libgtk-x11-2.0.la'
I included a directory listing in my message, showing that this file is there.

Perhaps you and John Emmas should read the messages before you reply to them.

The order of libs is wrong for $(pkg-config --libs gtk+-2.0)


-lgtk-x11-2.0 -lgdk-x11-2.0 should be at the end.

$ pkg-config --libs gtk+-2.0
-L/usr/X11R6/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangoxft-1.0 -lXft -lfreetype -lz -lXrender -lXext -lfontconfig -lpangox-1.0 -lX11 -lpango-1.0 -lm -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv


=>

-L/usr/X11R6/lib -latk-1.0 -lgdk_pixbuf-2.0 -lpangoxft-1.0 -lXft -lfreetype -lXrender -lXext -lfontconfig -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lgdk-x11-2.0 -lgtk-x11-2.0 -lX11 -lz -lintl -liconv

With that linker line it works okay.
But I don't know how pkgconfig should be patched to resolve the required pkg's recursively into the other direction.


Windows need the libs in the correct order, i.e. backwards.
--
Reini Urban
http://phpwiki.org/  http://murbreak.at/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/




--- End Message ---
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]