public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* GTK+ externals are unresolved
@ 2008-12-15 21:20 M.O.D.
  2008-12-15 22:32 ` Greg Chicares
  2008-12-15 22:45 ` John Emmas
  0 siblings, 2 replies; 17+ messages in thread
From: M.O.D. @ 2008-12-15 21:20 UTC (permalink / raw)
  To: cygwin

When I compile a GTK+ application in Cygwin, all the GTK externals are 
unresolved.  Output from pkg-config and the /usr/lib directory look fine, and 
are included below along with the linkage errors and the source program.

I downloaded and installed Cygwin last week.

I have compiled and run this little program on Slackware without any problem.

Why are the GTK externals going unresolved on Cygwin?

Thanks,
   Ollie

----------------------------------------------------------------------------
$ cc `pkg-config --cflags --libs gtk+-2.0` murg.c -o murg
/cygdrive/c/Users/pd/AppData/Local/Temp/ccPuIk43.o:murg.c:(.text+0x2b): 
undefined reference to `_gtk_set_locale'
/cygdrive/c/Users/pd/AppData/Local/Temp/ccPuIk43.o:murg.c:(.text+0x55): 
undefined reference to `_gtk_init_abi_check'
/cygdrive/c/Users/pd/AppData/Local/Temp/ccPuIk43.o:murg.c:(.text+0x61): 
undefined reference to `_gtk_window_new'
/cygdrive/c/Users/pd/AppData/Local/Temp/ccPuIk43.o:murg.c:(.text+0x73): 
undefined reference to `_gtk_widget_show_all'
/cygdrive/c/Users/pd/AppData/Local/Temp/ccPuIk43.o:murg.c:(.text+0x78): 
undefined reference to `_gtk_main'
collect2: ld returned 1 exit status
----------------------------------------------------------------------------

----------------------------------------------------------------------------
$ pkg-config --cflags --libs gtk+-2.0
-DXTHREADS -DXUSE_MTSAFE_API -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -
I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -
I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include  -
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
----------------------------------------------------------------------------

----------------------------------------------------------------------------
$ ls /usr/lib/*gtk*
/usr/lib/libgnorbagtk.dll.a    /usr/lib/libgtk.la
/usr/lib/libgnorbagtk.la       /usr/lib/libgtkhtml-2.dll.a
/usr/lib/libgtk-x11-2.0.dll.a  /usr/lib/libgtkhtml-2.la
/usr/lib/libgtk-x11-2.0.la     /usr/lib/libgtkxmhtml.dll.a
/usr/lib/libgtk.dll.a          /usr/lib/libgtkxmhtml.la
----------------------------------------------------------------------------

----------------------------------------------------------------------------
$ more murg.c
#include <stdio.h>
#include <gtk/gtk.h>

static GtkWidget* wintop;

int main (int argc, char **argv) {
gtk_set_locale ();
gtk_init (&argc, &argv);
wintop = gtk_window_new(GTK_WINDOW_TOPLEVEL);
/* Set up our GUI elements */
gtk_widget_show_all (wintop);
gtk_main ();
return 0;
}
----------------------------------------------------------------------------



--
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/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GTK+ externals are unresolved
  2008-12-15 21:20 GTK+ externals are unresolved M.O.D.
@ 2008-12-15 22:32 ` Greg Chicares
  2008-12-16  0:15   ` M.O.D.
  2008-12-15 22:45 ` John Emmas
  1 sibling, 1 reply; 17+ messages in thread
From: Greg Chicares @ 2008-12-15 22:32 UTC (permalink / raw)
  To: cygwin

On 2008-12-15 21:19Z, M.O.D. wrote:
> When I compile a GTK+ application in Cygwin, all the GTK externals are 
> unresolved.
> 
> $ cc `pkg-config --cflags --libs gtk+-2.0` murg.c -o murg

Does it work if you move the libraries after the source files?
Something like this:

  $ cc `pkg-config --cflags gtk+-2.0` murg.c `pkg-config --libs gtk+-2.0` -o murg

--
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/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re:  GTK+ externals are unresolved
  2008-12-15 21:20 GTK+ externals are unresolved M.O.D.
  2008-12-15 22:32 ` Greg Chicares
@ 2008-12-15 22:45 ` John Emmas
  2008-12-16  6:01   ` Andreas Eibach
  2008-12-16 19:08   ` M.O.D.
  1 sibling, 2 replies; 17+ messages in thread
From: John Emmas @ 2008-12-15 22:45 UTC (permalink / raw)
  To: cygwin

----- Original Message ----- 
From: "M.O.D."
Subject: GTK+ externals are unresolved
>
>
> Why are the GTK externals going unresolved on Cygwin?
>
> Thanks,
>   Ollie
>
> ----------------------------------------------------------------------------
> $ cc `pkg-config --cflags --libs gtk+-2.0` murg.c -o murg
> /cygdrive/c/Users/pd/AppData/Local/Temp/ccPuIk43.o:murg.c:(.text+0x2b):
> undefined reference to `_gtk_set_locale'
> /cygdrive/c/Users/pd/AppData/Local/Temp/ccPuIk43.o:murg.c:(.text+0x55):
> undefined reference to `_gtk_init_abi_check'
> /cygdrive/c/Users/pd/AppData/Local/Temp/ccPuIk43.o:murg.c:(.text+0x61):
> undefined reference to `_gtk_window_new'
> /cygdrive/c/Users/pd/AppData/Local/Temp/ccPuIk43.o:murg.c:(.text+0x73):
> undefined reference to `_gtk_widget_show_all'
> /cygdrive/c/Users/pd/AppData/Local/Temp/ccPuIk43.o:murg.c:(.text+0x78):
> undefined reference to `_gtk_main'
> collect2: ld returned 1 exit status
> ----------------------------------------------------------------------------
>
> ----------------------------------------------------------------------------
> $ pkg-config --cflags --libs gtk+-2.0
> -DXTHREADS -DXUSE_MTSAFE_API -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include
>  -
> I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -
> I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
> -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
> ----------------------------------------------------------------------------
>
Perhaps you're missing the file 'libgtk-x11-2.0.la' (it should be in /lib/).
Try linking to 'libgtk-x11-2.0.dll.a' temporarily.  If that works, you might
need to re-install gtk2-x11-devel.  Maybe part of it has gone missing.

John


--
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/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GTK+ externals are unresolved
  2008-12-15 22:32 ` Greg Chicares
@ 2008-12-16  0:15   ` M.O.D.
  0 siblings, 0 replies; 17+ messages in thread
From: M.O.D. @ 2008-12-16  0:15 UTC (permalink / raw)
  To: cygwin

> Does it work if you move the libraries after the source files?

No, that doesn't make any difference.





--
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/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GTK+ externals are unresolved
  2008-12-15 22:45 ` John Emmas
@ 2008-12-16  6:01   ` Andreas Eibach
  2008-12-16 19:08   ` M.O.D.
  1 sibling, 0 replies; 17+ messages in thread
From: Andreas Eibach @ 2008-12-16  6:01 UTC (permalink / raw)
  To: cygwin


----- Original Message ----- 
From: "John Emmas" <johne53@tiscali.co.uk>
To: <cygwin@cygwin.com>
Sent: Monday, December 15, 2008 11:45 PM
Subject: Re: GTK+ externals are unresolved

> Perhaps you're missing the file 'libgtk-x11-2.0.la' (it should be in
/lib/).
> Try linking to 'libgtk-x11-2.0.dll.a' temporarily.  If that works, you
might
> need to re-install gtk2-x11-devel.  Maybe part of it has gone missing.

That could be the "problem".

gtk2-x11* (Cygwin official) is from 2005 and does in no way comply to
modern GTK+ API standards.
The only way out might be a 2.1x version, which is only available on
Cygwin Ports ( http://sourceware.org/cygwinports )

-Andreas


--
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/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re:  GTK+ externals are unresolved
  2008-12-15 22:45 ` John Emmas
  2008-12-16  6:01   ` Andreas Eibach
@ 2008-12-16 19:08   ` M.O.D.
  2008-12-16 20:20     ` Reini Urban
  1 sibling, 1 reply; 17+ messages in thread
From: M.O.D. @ 2008-12-16 19:08 UTC (permalink / raw)
  To: cygwin

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.



--
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/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GTK+ externals are unresolved
  2008-12-16 19:08   ` M.O.D.
@ 2008-12-16 20:20     ` Reini Urban
  2008-12-16 20:38       ` Yaakov (Cygwin/X)
  0 siblings, 1 reply; 17+ messages in thread
From: Reini Urban @ 2008-12-16 20:20 UTC (permalink / raw)
  To: cygwin

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/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GTK+ externals are unresolved
  2008-12-16 20:20     ` Reini Urban
@ 2008-12-16 20:38       ` Yaakov (Cygwin/X)
  2008-12-17 19:26         ` Reini Urban
  0 siblings, 1 reply; 17+ messages in thread
From: Yaakov (Cygwin/X) @ 2008-12-16 20:38 UTC (permalink / raw)
  To: cygwin

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Reini Urban wrote:
> 
> 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

No, this is correct.

> Windows need the libs in the correct order, i.e. backwards.

No, the order is as with --as-needed on Linux, and in this case, where
all those libs are shared, the order doesn't matter at all as long as
they come after the object files which require them.


Yaakov
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEAREIAAYFAklIEX4ACgkQpiWmPGlmQSOEagCg+z7xRXQuBllMCordXqnN4U9y
92EAoMazY6W9kjayeOw2g577yq0BVHzw
=Vehj
-----END PGP SIGNATURE-----

--
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/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GTK+ externals are unresolved
  2008-12-16 20:38       ` Yaakov (Cygwin/X)
@ 2008-12-17 19:26         ` Reini Urban
  2008-12-17 22:37           ` Yaakov (Cygwin/X)
  0 siblings, 1 reply; 17+ messages in thread
From: Reini Urban @ 2008-12-17 19:26 UTC (permalink / raw)
  To: cygwin

Yaakov (Cygwin/X) schrieb:
> Reini Urban wrote:
>> 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
> 
> No, this is correct.
> 
>> Windows need the libs in the correct order, i.e. backwards.
> 
> No, the order is as with --as-needed on Linux, and in this case, where
> all those libs are shared, the order doesn't matter at all as long as
> they come after the object files which require them.

I tend to disagree.
With the original order:
-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

it fails to link, and with the reverse order of requires it works okay.

-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

The windows linker doesn't allow unresolved symbols at linktime, the 
linux linker does.
-- 
Reini


--
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/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GTK+ externals are unresolved
  2008-12-17 19:26         ` Reini Urban
@ 2008-12-17 22:37           ` Yaakov (Cygwin/X)
  2008-12-18  0:47             ` René Berber
  0 siblings, 1 reply; 17+ messages in thread
From: Yaakov (Cygwin/X) @ 2008-12-17 22:37 UTC (permalink / raw)
  To: cygwin

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Reini Urban wrote:
> I tend to disagree.
> With the original order:
> -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
> 
> it fails to link, and with the reverse order of requires it works okay.

Once again, these are all shared libraries, in which case the order
among them does NOT matter.  But if any of them were static, then this
top-down order is correct.

Obviously something else is the matter.  Are you mixing versions between
Ports and the distro, or even some self-built packages?  Where is the
- -L/usr/X11R6/lib coming from?


Yaakov
Cygwin/X
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEAREIAAYFAklJfukACgkQpiWmPGlmQSPNmQCg2XyLp0i/bOMUkR4wOeanSplY
+5cAoII/BkNy4+gUJCwKStGRLlyAru4E
=wfsU
-----END PGP SIGNATURE-----

--
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/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GTK+ externals are unresolved
  2008-12-17 22:37           ` Yaakov (Cygwin/X)
@ 2008-12-18  0:47             ` René Berber
  2008-12-18  6:01               ` Yaakov (Cygwin/X)
  0 siblings, 1 reply; 17+ messages in thread
From: René Berber @ 2008-12-18  0:47 UTC (permalink / raw)
  To: cygwin

Yaakov (Cygwin/X) wrote:

> Once again, these are all shared libraries, in which case the order
> among them does NOT matter.  But if any of them were static, then this
> top-down order is correct.
[snip]

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.
-- 
René Berber


--
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/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GTK+ externals are unresolved
  2008-12-18  0:47             ` René Berber
@ 2008-12-18  6:01               ` Yaakov (Cygwin/X)
  2008-12-20 15:44                 ` Reini Urban
  0 siblings, 1 reply; 17+ messages in thread
From: Yaakov (Cygwin/X) @ 2008-12-18  6:01 UTC (permalink / raw)
  To: cygwin

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

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.


Yaakov
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEAREIAAYFAklJ5v0ACgkQpiWmPGlmQSOK5ACfQch13kybWhj85NvVhyBNuBOZ
WmAAn0f3FHHMdB/OM2G9FUix46h1N7Hp
=kCJa
-----END PGP SIGNATURE-----

--
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/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GTK+ externals are unresolved
  2008-12-18  6:01               ` Yaakov (Cygwin/X)
@ 2008-12-20 15:44                 ` Reini Urban
  2008-12-21  0:45                   ` Yaakov (Cygwin/X)
  0 siblings, 1 reply; 17+ messages in thread
From: Reini Urban @ 2008-12-20 15:44 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1227 bytes --]

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


[-- Attachment #2: Nachricht als Attachment --]
[-- Type: message/rfc822, Size: 4754 bytes --]

From: Reini Urban <rurban@x-ray.at>
To: cygwin@cygwin.com
Subject: Re: GTK+ externals are unresolved
Date: Tue, 16 Dec 2008 21:19:41 +0100
Message-ID: <49480D5D.8090002@x-ray.at>

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/




[-- Attachment #3: Type: text/plain, Size: 218 bytes --]

--
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/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GTK+ externals are unresolved
  2008-12-20 15:44                 ` Reini Urban
@ 2008-12-21  0:45                   ` Yaakov (Cygwin/X)
  2008-12-21 15:29                     ` M.O.D.
  0 siblings, 1 reply; 17+ messages in thread
From: Yaakov (Cygwin/X) @ 2008-12-21  0:45 UTC (permalink / raw)
  To: cygwin

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Reini Urban wrote:
> 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.

Listen, I've been building GNOME for years now.  pkg-config's output is
correct and it works, and I've already explained why.  I've already
stated what I think the problem really is, have you looked at that?


Yaakov
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEAREIAAYFAklNkV0ACgkQpiWmPGlmQSMjIQCg8C8CuFipYbisBEVe27CIvHGI
Xk8An2ThlM4VYfO/xN7SAexpt7tRJAjR
=0Amr
-----END PGP SIGNATURE-----

--
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/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GTK+ externals are unresolved
  2008-12-21  0:45                   ` Yaakov (Cygwin/X)
@ 2008-12-21 15:29                     ` M.O.D.
  2008-12-21 16:18                       ` Yaakov (Cygwin/X)
  0 siblings, 1 reply; 17+ messages in thread
From: M.O.D. @ 2008-12-21 15:29 UTC (permalink / raw)
  To: cygwin

Thanks for your comments, Yaakov.  As you suspected, the order of the link
libraries made no difference.

I downloaded all of Cygwin at one time, in about an hour.  I have not done
anything I know of that would mix versions.  If there is some kind of library
mismatch, I have no idea what to do about it.  I am going to run setup again
today, in order to download whatever updates have become available since I first
installed a couple of weeks ago.

Any other recommendations?

Thanks,
   Ollie




--
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/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GTK+ externals are unresolved
  2008-12-21 15:29                     ` M.O.D.
@ 2008-12-21 16:18                       ` Yaakov (Cygwin/X)
  2008-12-22 13:29                         ` M.O.D.
  0 siblings, 1 reply; 17+ messages in thread
From: Yaakov (Cygwin/X) @ 2008-12-21 16:18 UTC (permalink / raw)
  To: cygwin

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

M.O.D. wrote:
> Thanks for your comments, Yaakov.  As you suspected, the order of the link
> libraries made no difference.
> 
> I downloaded all of Cygwin at one time, in about an hour.  I have not done
> anything I know of that would mix versions.  If there is some kind of library
> mismatch, I have no idea what to do about it.  I am going to run setup again
> today, in order to download whatever updates have become available since I first
> installed a couple of weeks ago.
> 
> Any other recommendations?

First, make sure that your -devel packages are installed properly:

pkg-config --modversion gtk+-2.0

Second, as mentioned earlier, the libs must follow the object files, IOW:

gcc -o murg murg.c `pkg-config --cflags --libs gtk+-2.0`

(The placement of the cflags doesn't matter; only the libs.  Doing it
like this makes for only one pkg-config call instead of two.)

You're simple test case doesn't appear to use any new APIs, so that
should work.


Yaakov
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEAREIAAYFAklObBAACgkQpiWmPGlmQSNGiwCgmWieFa+5yoxnB5ceXIDEBcld
bcwAniDDwEPe7B2xa9OX/mNLfiVWhu88
=EjK1
-----END PGP SIGNATURE-----

--
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/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GTK+ externals are unresolved
  2008-12-21 16:18                       ` Yaakov (Cygwin/X)
@ 2008-12-22 13:29                         ` M.O.D.
  0 siblings, 0 replies; 17+ messages in thread
From: M.O.D. @ 2008-12-22 13:29 UTC (permalink / raw)
  To: cygwin

> gcc -o murg murg.c `pkg-config --cflags --libs gtk+-2.0`
This worked, and it sounded so similar to what Greg Chicares recommended 
earlier that I went back to his message and rearranged the command again as he 
described, and that also worked this time.  I don't know how I dorked that up 
the first time.  I'm probably too scatter-brained to work with this kind of 
language, where any random typo that most humans wouldn't even notice sends the 
computer off to a strange place.  But it's intriguing stuff, so I'm going to 
try to get a few widgets to work.

Thanks Yaakov -- and to Greg as well.
   Ollie



--
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/

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2008-12-22 13:29 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-15 21:20 GTK+ externals are unresolved M.O.D.
2008-12-15 22:32 ` Greg Chicares
2008-12-16  0:15   ` M.O.D.
2008-12-15 22:45 ` John Emmas
2008-12-16  6:01   ` Andreas Eibach
2008-12-16 19:08   ` M.O.D.
2008-12-16 20:20     ` Reini Urban
2008-12-16 20:38       ` Yaakov (Cygwin/X)
2008-12-17 19:26         ` Reini Urban
2008-12-17 22:37           ` Yaakov (Cygwin/X)
2008-12-18  0:47             ` René Berber
2008-12-18  6:01               ` Yaakov (Cygwin/X)
2008-12-20 15:44                 ` Reini Urban
2008-12-21  0:45                   ` Yaakov (Cygwin/X)
2008-12-21 15:29                     ` M.O.D.
2008-12-21 16:18                       ` Yaakov (Cygwin/X)
2008-12-22 13:29                         ` M.O.D.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).