Author Topic: Gtk2 Issue In Compiling  (Read 4293 times)

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Gtk2 Issue In Compiling
« on: December 02, 2005, 01:30:53 pm »
Good day!

I've been trying to compile a couple of apps that required GTK2 on my Z (C1000 rc12).  However, unfortunately I got none of them complied because of the same error during configure:

Code: [Select]
checking for GTK+ - version >= 2.0.3... no
*** Could not run GTK+ test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occured. This usually means GTK+ is incorrectly installed.
configure: error: *** GTK >= 2.0.3 not found ***

Isn't true that GTK2 is already installed in rc12?  I tried to prefix the path like this but still to no avail:
Code: [Select]
--with-gtk-prefix=/usr/lib/gtk/gtk-2.0/2.4.0
But pgas assured me that GTK apps should be compiled well on Z.  Or did I miss something crucial here?    

Please enlighten this newbie before he finally freaks out.  Thanks!  
« Last Edit: December 02, 2005, 01:31:36 pm by ZDevil »

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Gtk2 Issue In Compiling
« Reply #1 on: December 02, 2005, 01:55:55 pm »
Not sure if this is relevant.  Here is what I find concerning the gtk2 error in config.log when compiling gtk2-enabled JPilot:

Code: [Select]
configure:23049: result: GTK2 support enabled by configure options
configure:23078: checking for pkg-config
configure:23096: found /opt/native/arm/3.4.4-xscale-softvfp/bin/pkg-config
configure:23109: result: /opt/native/arm/3.4.4-xscale-softvfp/bin/pkg-config
configure:23130: checking for GTK+ - version >= 2.0.3
configure:23275: result: no
configure:23308: gcc -o conftest -g -O2  
-I/mnt/card/jpilot/pilot-link-0.12.0-pre4/incl$
conftest.c:37:21: gtk/gtk.h: No such file or directory
conftest.c: In function `main':
conftest.c:43: error: `gtk_major_version' undeclared (first use in this
function)
conftest.c:43: error: (Each undeclared identifier is reported only once
conftest.c:43: error: for each function it appears in.)
conftest.c:43: error: `gtk_minor_version' undeclared (first use in this
function)
conftest.c:43: error: `gtk_micro_version' undeclared (first use in this
function)
configure:23314: $? = 1
configure: failed program was:
| /* confdefs.h.  */

(I added --with-pilot-prefix=/mnt/card/...  because the required pilot-link headers are there.)

Thanks!!  

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

pgas

  • Hero Member
  • *****
  • Posts: 1097
    • View Profile
    • http://
Gtk2 Issue In Compiling
« Reply #2 on: December 05, 2005, 03:22:43 am »
hmm, difficult to say what the problem is without trying, can you please post a link to the sources you are trying to compile?

pkgc-config retrune the flags for compiling gtk2.0 apps you can try
Code: [Select]
pkg-config --clfags gtk+-2.0
pkg-config --libs gtk+-2.0

You can check how the test is done in the configure script, and check what goes wrong, maybe bypassing the test..
SLC-860 cacko / senao wifi

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Gtk2 Issue In Compiling
« Reply #3 on: December 05, 2005, 04:58:28 am »
That's very nice of you, pgas.    

I was trying to compile about half a dozen apps requiring gtk+, here are two of them:
The first is JPilot
Requirement: http://www.jpilot.org/requirements.html
Source: http://jpilot.org/jpilot-0.99.8.tar.gz
Patch 1: http://www.jpilot.org/patch.jpilot-sync
Patch 2: http://www.neonbox.org/zaurus/jpilot-0.99.8-armfix.diff
Patch 3: http://www.neonbox.org/zaurus/jpilot-0.99....gfault_fix.diff
(Finally learned how to apply patches after doing googling for quite a while ...   )

To sync devices, Pilot-link also has to be compiled.
Source: http://www.pilot-link.org/filestore2/downl....0-pre4.tar.bz2

I was trying to compile it with --enable-gtk2 (for multi-language support) flag and to get all the plugins (esp keyring and mail) included, but ran into errors as described above.

Another app is leafpad 0.8.5 (with several fixes of the older versions.  0.7.8 is available as a pdaXrom ipk)
Source: http://savannah.nongnu.org/download/leafpa...ad-0.8.5.tar.gz

Meanwhile I'll also have a go with the instruction you gave after work today.  
Thanks!  
« Last Edit: December 05, 2005, 05:07:13 am by ZDevil »

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Gtk2 Issue In Compiling
« Reply #4 on: December 05, 2005, 05:46:38 am »
Quote
hmm, difficult to say what the problem is without trying, can you please post a link to the sources you are trying to compile?

pkgc-config retrune the flags for compiling gtk2.0 apps you can try
Code: [Select]
pkg-config --clfags gtk+-2.0
pkg-config --libs gtk+-2.0

You can check how the test is done in the configure script, and check what goes wrong, maybe bypassing the test..
[div align=\"right\"][a href=\"index.php?act=findpost&pid=106050\"][{POST_SNAPBACK}][/a][/div]


Just can't resist the temptation so I fish my Z out from my sag to try.  
Then a question popped up:  
I found pkg-config in the native SDK image.  How can I retune the flags and where should I put them?  
Pardon my being so obliviously n00b.  Thanks again.

[Update]
Ok, now figure it out.  Stupid me   (Very often discover the answer shortly after asking stupid questions. Maybe that's life? )
Just do
Code: [Select]
export PKG_CONFIG_PATH=/opt/native/arm/3.4.4-scale-softvfp/armv5tel-cack0-linux/lib/pkg-configbefore doing pkg-config --cflags gtk+-2.0 and pkg-config --libs gtk+-2.0.
No need to skip the test.  Configured JPilot successfully.  Let's see how make goes.  
« Last Edit: December 05, 2005, 06:32:36 am by ZDevil »

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

pgas

  • Hero Member
  • *****
  • Posts: 1097
    • View Profile
    • http://
Gtk2 Issue In Compiling
« Reply #5 on: December 05, 2005, 07:00:04 am »
hmm, PKG_CONFIG_PATH is set correctly for me in /etc/profile by default

Can you check your /etc/profile?

Note that pkg-config --cflags gtk+-2.0   just print the list of flags that should be use as arguments to gcc to compile gtk+-2.0, it does not actually do/set anything.
SLC-860 cacko / senao wifi

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Gtk2 Issue In Compiling
« Reply #6 on: December 05, 2005, 07:11:40 am »
Quote
hmm, PKG_CONFIG_PATH is set correctly for me in /etc/profile by default

Can you check your /etc/profile?

Note that pkg-config --cflags gtk+-2.0   just print the list of flags that should be use as arguments to gcc to compile gtk+-2.0, it does not actually do/set anything.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=106071\"][{POST_SNAPBACK}][/a][/div]

Just checked my /etc/profile.  What's funny is that there is a missing "-" in all "pkg-config" in the path:
The original:
Code: [Select]
PKG_CONFIG_PATH=PKG_CONFIG_PATH=/opt/native/arm/3.4.4-scale-softvfp/armv5tel-cack0-linux/lib/pkgconfig:/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/X11R6/lib/pkgconfigshould be ... ?:
Code: [Select]
PKG_CONFIG_PATH=PKG_CONFIG_PATH=/opt/native/arm/3.4.4-scale-softvfp/armv5tel-cack0-linux/lib/pkg-config:/usr/lib/pkg-config:/usr/local/lib/pkgcon-fig:/usr/X11R6/lib/pkg-config
As far as i can remember, I've never tampered with the PKG_CONFIG_PATH lines.  Could it be something else that causes this (e.g. packages installed with the wrong paths?)  Or am I just further misleading myself into a more n00b path?  

Thanks again.  
« Last Edit: December 05, 2005, 07:13:27 am by ZDevil »

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

pgas

  • Hero Member
  • *****
  • Posts: 1097
    • View Profile
    • http://
Gtk2 Issue In Compiling
« Reply #7 on: December 05, 2005, 07:23:54 am »
hmm, what sdk are you using? the zgcc image?

the *.pc files are in /opt/native/arm/3.4.4-scale-softvfp/armv5tel-cack0-linux/lib/pkgconfig and not in pkg-config for me.
SLC-860 cacko / senao wifi

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Gtk2 Issue In Compiling
« Reply #8 on: December 05, 2005, 08:04:29 am »
Quote
hmm, what sdk are you using? the zgcc image?

the *.pc files are in /opt/native/arm/3.4.4-scale-softvfp/armv5tel-cack0-linux/lib/pkgconfig and not in pkg-config for me.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=106074\"][{POST_SNAPBACK}][/a][/div]

Yes, I'm using the zgcc 3.4.4 image.
Right... this is what confuses me.  See how this n00b is confusing himself all the time instead of making good progress.  
At first when I used pkg-config --clfags gtk+-2.0 and pkg-config --libs gtk+-2.0, an error popped up asking me to check the PKG_CONFIG_PATH.
So I located the paths in the /etc/profile , and then I export PKG_CONFIG_PATH to the path as in /etc/profile.  After that I pkg-config --clfags gtk+-2.0 and pkg-config --libs gtk+-2.0 without errors, and configured simply went through.  
So my hunch is i still need to export the path manually in order to avoid the GTK2 not found error during configure.
Please, give me an explanation to let this n00b see some light in the darkness.  
I have yet to try the other apps.  Perhaps I will test this on leafpad 0.8.5 after building a gtk2-enabled version of JPilot.

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

pgas

  • Hero Member
  • *****
  • Posts: 1097
    • View Profile
    • http://
Gtk2 Issue In Compiling
« Reply #9 on: December 05, 2005, 08:10:13 am »
you should not have to export PKG_CONFIG_PATH manually, it works for me....so no explanation
SLC-860 cacko / senao wifi