participate


New to Solaris Development - Solaris Express Developer 9/07 gcc can't find GTK-2
This question is not answered.

<<   Back to Forum  |   Give us Feedback Topics: « Previous | Next
This topic has 22 replies on 2 pages.    1 | 2 | Next »
jhawk
Posts:20
Registered: 11/7/06
Solaris Express Developer 9/07 gcc can't find GTK-2   
Oct 10, 2007 12:02 PM
 
 
Solaris Express Developer 9/07 configure can't find GTK-2
located in /usr/lib/gtk-2.0 & /usr/include/gtk-2.0

It is my understanding that default ld includes /usr/lib (i.e. crle ouput)

Any help appreciated.

John

Update:
installed packages /opt/cfw
atk-1.10.1-Solaris10-x86.pkg
gtk-2.8.3-Solaris10-x86.pkg
cairo-1.0.0-Solaris10-x86.pkg
pango-1.10.0-Solaris10-x86.pkg
glib-2.8.1-Solaris10-x86.pkg

Configuration file [version 4]: /var/ld/ld.config
Platform: 32-bit LSB 80386
Default Library Path (ELF): /lib:/usr/lib:/usr/local/lib:/opt/sfw/lib:/opt/cfw/lib:/opt/gnu/lib
Trusted Directories (ELF): /lib/secure:/usr/lib/secure (system default)

Command line:
crle -c /var/ld/ld.config -l /lib:/usr/lib:/usr/local/lib:/opt/sfw/lib:/opt/cfw/lib:/opt/gnu/lib

Still fails!

Edited by: jhawk on Oct 10, 2007 7:01 PM
 
robert.cohen
Posts:1,999
Registered: 7/08/06
Re: Solaris Express Developer 9/07 gcc can't find GTK-2   
Oct 10, 2007 9:17 PM (reply 1 of 22)  (In reply to original post )
 
 
You havent explained what is failing.
Show the commands you are using and what the output is.

ldd output for the resulting executable would also be useful.

As far as library location goes, you are generally better off tweaking the compilation to add -L and -R to the compile lines to specify the locations of libraries than fiddling around with crle.

Since -R is a fairly solaris specific thing its not uncommon for the makefile to specify -L only. The result is that the compiler finds the library when making the executable. But when you try to run it, it fails to find the library at runtime.
 
jhawk
Posts:20
Registered: 11/7/06
Re: Solaris Express Developer 9/07 gcc can't find GTK-2   
Oct 11, 2007 5:27 AM (reply 2 of 22)  (In reply to #1 )
 
 
jhawk@solaris-devx gftp-2.0.18rc1 >export LD_LIBRARY_PATH=/opt/cfw/lib/gtk-2.0:/lib:/usr/lib:/usr/local/lib:/opt/sfw/lib
jhawk@solaris-devx gftp-2.0.18rc1 >./configure --prefix=/usr/local
checking for a BSD-compatible install... /usr/bin/ginstall -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
checking build system type... i386-pc-solaris2.11
checking host system type... i386-pc-solaris2.11
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for egrep... egrep
checking for AIX... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking for ranlib... ranlib
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... 64
checking for _LARGE_FILES value needed for large files... no
checking for gcc option to accept ANSI C... none needed
checking for function prototypes... yes
checking for ANSI C header files... (cached) yes
checking for string.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking whether the printf family of functions supports %'ld... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gawk... (cached) nawk
checking for a BSD-compatible install... /usr/bin/ginstall -c
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking for ANSI C header files... (cached) yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking libutil.h usability... no
checking libutil.h presence... no
checking for libutil.h... no
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking pty.h usability... no
checking pty.h presence... no
checking for pty.h... no
checking for strings.h... (cached) yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for stdint.h... (cached) yes
checking sys/mkdev.h usability... yes
checking sys/mkdev.h presence... yes
checking for sys/mkdev.h... yes
checking for inttypes.h... (cached) yes
checking for socklen_t in sys/socket.h... yes
checking for mode_t... yes
checking for intptr_t in stdint.h... yes
checking for pid_t... yes
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for off_t... yes
checking size of off_t... 8
checking for working alloca.h... yes
checking for alloca... yes
checking whether gcc needs -traditional... no
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for getpagesize... yes
checking for working mmap... yes
checking return type of signal handlers... void
checking for strftime... yes
checking whether utime accepts a null argument... yes
checking for gai_strerror... no
checking for getaddrinfo... no
checking for getcwd... yes
checking for gettimeofday... yes
checking for getwd... yes
checking for mkdir... yes
checking for mktime... yes
checking for putenv... yes
checking for rmdir... yes
checking for select... yes
checking for socket... no
checking for strdup... yes
checking for strstr... yes
checking for strtod... yes
checking for strtol... yes
checking for uname... yes
checking for grantpt... yes
checking for openpty... no
checking for getdtablesize... yes
checking for pkg-config... /usr/bin/pkg-config
checking for glib-2.0 >= 2.0.0... yes
checking GLIB_CFLAGS... -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
checking GLIB_LIBS... -lglib-2.0
checking for openpty in -lutil... no
checking for socket in -lsocket... yes
checking for gethostbyname in -lnsl... yes
checking whether to use readline... yes
checking for readline in -lreadline... no
checking for readline in -lreadline... no
checking for readline in -lreadline... no
checking for readline in -lreadline... no
checking for log10 in -lm... yes
checking if malloc debugging is wanted... no
checking for gtk+-2.0 >= 2.0.0... configure: error: You have GLIB 2.0 installed but I cannot find GTK+ 2.0. Run configure with --disable-gtk20 or install GTK+ 2.0
jhawk@solaris-devx gftp-2.0.18rc1 >
 
alan.pae
Posts:1,447
Registered: 9/6/06
Re: Solaris Express Developer 9/07 gcc can't find GTK-2   
Oct 11, 2007 11:40 AM (reply 3 of 22)  (In reply to original post )
 
 
Update:
installed packages /opt/cfw
atk-1.10.1-Solaris10-x86.pkg
gtk-2.8.3-Solaris10-x86.pkg
cairo-1.0.0-Solaris10-x86.pkg
pango-1.10.0-Solaris10-x86.pkg
glib-2.8.1-Solaris10-x86.pkg

Depending on who and how they compiled these packages I would expect to find something like:

ls -l /opt/cfw/lib/pkgconfig

*.pc

Then just add /opt/cfw/lib/pkgconfig to your package config variables.

man pkg-config for details.

alan
 
alan.pae
Posts:1,447
Registered: 9/6/06
Re: Solaris Express Developer 9/07 gcc can't find GTK-2   
Oct 11, 2007 11:42 AM (reply 4 of 22)  (In reply to #1 )
 
 
Since -R is a fairly solaris specific thing its not uncommon for the makefile to specify -L only. The result is that the compiler finds the library when making the executable. But when you try to run it, it fails to find the library at runtime.

-R is a linker flag. Solaris's linker can use it and I would assume that anyone who uses the GNU linker can specify it as well.

alan
 
alan.pae
Posts:1,447
Registered: 9/6/06
Re: Solaris Express Developer 9/07 gcc can't find GTK-2   
Oct 11, 2007 11:44 AM (reply 5 of 22)  (In reply to #2 )
 
 
checking for gtk+-2.0 >= 2.0.0... configure: error: You have GLIB 2.0 installed but I cannot find GTK+ 2.0. Run configure with --disable-gtk20 or install GTK+ 2.0
jhawk@solaris-devx gftp-2.0.18rc1 >

What does:

cat /var/sadm/install/contents | grep gtk

show?

alan
 
jhawk
Posts:20
Registered: 11/7/06
Re: Solaris Express Developer 9/07 gcc can't find GTK-2   
Oct 12, 2007 6:44 AM (reply 6 of 22)  (In reply to #5 )
 
 
Configure string:
./configure --prefix=/usr/local CFLAGS="-g -O3 -Wall -funsigned-char -I/usr/lib/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -L /lib:/usr/lib:/usr/local/lib:/opt/sfw/lib:/usr/lib/gtk-2.0"

checking for GTK+ - version >= 2.10.0... 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.

Log output:

Extremely large out snippet:

configure:26311: checking for GTK+ - version >= 2.10.0
configure:26456: result: no
configure:26489: gcc -o conftest -g -O3 -Wall -funsigned-char -I/usr/lib/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -L /lib:/usr/lib:/usr/local/lib:/opt/sfw/lib:/usr/lib/gtk-2.0 conftest.c >&5
In file included from /usr/include/gtk-2.0/gdk/gdkcairo.h:23,
from /usr/include/gtk-2.0/gdk/gdk.h:30,
from /usr/include/gtk-2.0/gtk/gtk.h:31,
from conftest.c:81:
/usr/include/gtk-2.0/gdk/gdkcolor.h:30:19: cairo.h: No such file or directory
In file included from /usr/include/gtk-2.0/gdk/gdkcolor.h:31,
from /usr/include/gtk-2.0/gdk/gdkcairo.h:23,
from /usr/include/gtk-2.0/gdk/gdk.h:30,
from /usr/include/gtk-2.0/gtk/gtk.h:31,
from conftest.c:81:
/usr/include/gtk-2.0/gdk/gdktypes.h:32:18: glib.h: No such file or directory
/usr/include/gtk-2.0/gdk/gdktypes.h:33:25: pango/pango.h: No such file or directory
/usr/include/gtk-2.0/gdk/gdktypes.h:34:25: glib-object.h: No such file or directory
In file included from /usr/include/gtk-2.0/gdk/gdkcolor.h:31,
from /usr/include/gtk-2.0/gdk/gdkcairo.h:23,
from /usr/include/gtk-2.0/gdk/gdk.h:30,
from /usr/include/gtk-2.0/gtk/gtk.h:31,
from conftest.c:81:
/usr/include/gtk-2.0/gdk/gdktypes.h:64: error: syntax error before "typedef"
/usr/include/gtk-2.0/gdk/gdktypes.h:74: error: syntax error before "GdkWChar"
/usr/include/gtk-2.0/gdk/gdktypes.h:74: warning: type defaults to `int' in declaration of `GdkWChar'
/usr/include/gtk-2.0/gdk/gdktypes.h:74: warning: data definition has no type or storage class
/usr/include/gtk-2.0/gdk/gdktypes.h:87: error: syntax error before "GdkNativeWindow"
/usr/include/gtk-2.0/gdk/gdktypes.h:87: warning: type defaults to `int' in declaration of `GdkNativeWindow'
/usr/include/gtk-2.0/gdk/gdktypes.h:87: warning: data definition has no type or storage class
/usr/include/gtk-2.0/gdk/gdktypes.h:174: error: syntax error before "data"
/usr/include/gtk-2.0/gdk/gdktypes.h:178: error: syntax error before "data"

cat /var/sadm/install/contents | grep gtk

returns only .png files from gnomeThemes

./configure --prefix=/usr/local*

configure:26311: checking for GTK+ - version >= 2.10.0
configure:26456: result: no
configure:26489: gcc -o conftest -g -O2 conftest.c >&5
conftest.c:81:21: gtk/gtk.h: No such file or directory
conftest.c: In function `main':
conftest.c:87: error: `gtk_major_version' undeclared (first use in this function)
conftest.c:87: error: (Each undeclared identifier is reported only once
conftest.c:87: error: for each function it appears in.)
conftest.c:87: error: `gtk_minor_version' undeclared (first use in this function)
conftest.c:87: error: `gtk_micro_version' undeclared (first use in this function)
configure:26495: $? = 1
configure: failed program was:
| / confdefs.h. /

Edited by: jhawk on Oct 12, 2007 1:42 PM
 
alan.pae
Posts:1,447
Registered: 9/6/06
Re: Solaris Express Developer 9/07 gcc can't find GTK-2   
Oct 12, 2007 1:13 PM (reply 7 of 22)  (In reply to #6 )
 
 
/usr/include/gtk-2.0/gdk/gdkcolor.h:30:19: cairo.h: No such file or directory
/usr/include/gtk-2.0/gdk/gdktypes.h:32:18: glib.h: No such file or directory
/usr/include/gtk-2.0/gdk/gdktypes.h:33:25: pango/pango.h: No such file or directory

Gnome was a lot easier in the version 1.x incarnation then in it's present incarnation. I'm convinced that Sun does not include all of Gnome but just what is needed for their version (JDS.)

Let's do this the hard way with the find command.

find / -name cairo.h for the first error. If not then you need to configure and install Cairo before continuing.

find / -name glib.h for the second error. I find this hard to believe since glib is a base dependency for Gnome.

find / -name pango.h for the third error. Same as Cairo. If you don't have it then you need to add it.

For error number four see my listing for error number two.

conftest.c:81:21: gtk/gtk.h: No such file or directory

Without GTK you can't have a working Gnome environment AFAIK.

find / -name gtk.h

You might hunt around sunfreeware.com for a precompiled GFTP. I use FireFTP as a Firefox added component.

alan
 
jhawk
Posts:20
Registered: 11/7/06
Re: Solaris Express Developer 9/07 gcc can't find GTK-2   
Oct 13, 2007 5:28 AM (reply 8 of 22)  (In reply to #7 )
 
 
Find Results

/usr/include/glib-2.0/glib.h
/usr/include/pango-1.0/pango/pango.h
/usr/include/glib-2.0/glib.h
/usr/include/gtk-2.0/gtk/gtk.h
/usr/include/cairo/cairo.h

CRLE is reset ot original

Default configuration file (/var/ld/ld.config) not found
Platform: 32-bit LSB 80386
Default Library Path (ELF): /lib:/usr/lib (system default)
Trusted Directories (ELF): /lib/secure:/usr/lib/secure (system default)
 
jhawk
Posts:20
Registered: 11/7/06
Re: Solaris Express Developer 9/07 gcc can't find GTK-2   
Oct 13, 2007 8:46 AM (reply 9 of 22)  (In reply to #8 )
 
 
I have come of the opinion that Solaris Express Developer 9/07 is not worth wasting my time with at this time.
Perhaps in the future it will get basic configurations correct.

Thanks for the help.

John
 
alan.pae
Posts:1,447
Registered: 9/6/06
Re: Solaris Express Developer 9/07 gcc can't find GTK-2   
Oct 13, 2007 1:08 PM (reply 10 of 22)  (In reply to #8 )
 
 
/usr/include/glib-2.0/glib.h
/usr/include/pango-1.0/pango/pango.h
/usr/include/glib-2.0/glib.h
/usr/include/gtk-2.0/gtk/gtk.h
/usr/include/cairo/cairo.h

CRLE is reset ot original

Well you're almost there if you don't give up.

It looks like everything is in the proper places for a Solaris build so you should have:

/usr/lib/pkgconfig/*.pc files.

One of those .pc files should match up to each of the individual outputs of what you did with the find command. So know all you need to do is to add /usr/lib/pkgconfig to the PKG_CONFIG_PATH environment variable and then run configure again for gFTP.

gFTP should use the PKG_CONFIG_PATH to find the .pc files which will in turn tell configure what paths to add so it knows where to find things. From there it should all be downhill. Don't worry about crle as you really don't need to modify it. Instead set LD_FLAGS="-R /path/to/gftp/library/path/after/you/run/make/install and then you don't need crle or LD_LIBRARY_PATH.

alan

Edited by: alan.pae on Oct 13, 2007 1:08 PM
 
jhawk
Posts:20
Registered: 11/7/06
Re: Solaris Express Developer 9/07 gcc can't find GTK-2   
Oct 13, 2007 4:29 PM (reply 11 of 22)  (In reply to #10 )
 
 
OK gftp built with new install atk cario pango gtk glib installed in /opt/cfw

Pacages added:
pkgadd -d atk-1.10.1-Solaris10-x86.pkg
pkgadd -d cairo-1.0.0-Solaris10-x86.pkg
pkgadd -d pango-1.10.0-Solaris10-x86.pkg
pkgadd -d gtk-2.8.3-Solaris10-x86.pkg
pkgadd -d glib-2.8.1-Solaris10-x86.pkg

Options:
export PKG_CONFIG_PATH="/opt/cfw/lib/pkgconfig"
export PATH="/opt/cfw/bin:$PATH"
export LD_LIBRARY_PATH="/opt/cfw/lib:/lib:/usr/lib"
./configure --prefix=/usr/local --with-glib-prefix=/opt/cfw --with-gtk-prefix=/opt/cfw CC="gcc" --with-gnu-ld

However, xchat fails finding gtk version 2.10.0 in /usr/lib (e.g uses > version which fails test build)
 
alan.pae
Posts:1,447
Registered: 9/6/06
Re: Solaris Express Developer 9/07 gcc can't find GTK-2   
Oct 15, 2007 2:53 PM (reply 12 of 22)  (In reply to #11 )
 
 
jhawk wrote:
OK gftp built with new install atk cario pango gtk glib installed in /opt/cfw

Ok, what is /opt/cfw? Aren't these the one's that you used find to find in /usr/ ?

Pacages added:
pkgadd -d atk-1.10.1-Solaris10-x86.pkg
pkgadd -d cairo-1.0.0-Solaris10-x86.pkg
pkgadd -d pango-1.10.0-Solaris10-x86.pkg
pkgadd -d gtk-2.8.3-Solaris10-x86.pkg
pkgadd -d glib-2.8.1-Solaris10-x86.pkg

And the packages came from where?

Options:
export PKG_CONFIG_PATH="/opt/cfw/lib/pkgconfig"
export PATH="/opt/cfw/bin:$PATH"
export LD_LIBRARY_PATH="/opt/cfw/lib:/lib:/usr/lib"
./configure --prefix=/usr/local --with-glib-prefix=/opt/cfw --with-gtk-prefix=/opt/cfw CC="gcc" --with-gnu-ld
However, xchat fails finding gtk version 2.10.0 in /usr/lib (e.g uses > version which fails test build)

Looks good except that I would not use "--with-gnu-ld." I would stay with the stock Solaris linker.

gFTP is working then?

Xchat is yet another program that you wish to compile? If so let's do these one at a time please.

alan
 
jhawk
Posts:20
Registered: 11/7/06
Re: Solaris Express Developer 9/07 gcc can't find GTK-2   
Oct 15, 2007 4:17 PM (reply 13 of 22)  (In reply to #12 )
 
 
Gftp is built with GTK-2.0 v 2.8.3 and working.

Xchat requires GTK-2.0 > 2.10 since GTK-2.0 v 2.10.12 is miss-configured and fails. It is impossible to build at this time.

I can not find the reason for Gtk-2.0 v 2.10.12 inability to find files.

jhawk@solaris-devx xchat-2.8.4 >path
/usr/bin
/usr/dt/bin
/usr/openwin/bin
/usr/ccs/bin
/usr/sfw/bin
/opt/sfw/bin
/usr/local/bin
jhawk@solaris-devx xchat-2.8.4 >ldpath
/lib
/usr/lib
/usr/local/lib
jhawk@solaris-devx xchat-2.8.4 >pkpath
/usr/lib/lib/pkgconfig
jhawk@solaris-devx xchat-2.8.4 >./configure --prefix=/usr/local

output config.log
configure:28242: checking for pkg-config
configure:28273: result: /usr/bin/pkg-config
configure:28295: checking for GTK+ - version >= 2.10.0
configure:28451: result: no
configure:28489: gcc -o conftest -g -O2 -D_REENTRANT conftest.c >&5
conftest.c:84:21: gtk/gtk.h: No such file or directory
conftest.c: In function `main':
conftest.c:90: error: `gtk_major_version' undeclared (first use in this function)
conftest.c:90: error: (Each undeclared identifier is reported only once
conftest.c:90: error: for each function it appears in.)
conftest.c:90: error: `gtk_minor_version' undeclared (first use in this function)
conftest.c:90: error: `gtk_micro_version' undeclared (first use in this function)
configure:28495: $? = 1
configure: failed program was:
| / confdefs.h. /
 
alan.pae
Posts:1,447
Registered: 9/6/06
Re: Solaris Express Developer 9/07 gcc can't find GTK-2   
Oct 15, 2007 5:29 PM (reply 14 of 22)  (In reply to #13 )
 
 
CFLAGS="/usr/include/gtk-2.0/"; export CFLAGS
configure ...

alan
 
This topic has 22 replies on 2 pages.    1 | 2 | Next »
Back to Forum
 
Read the Developer Forums Code of Conduct

Click to email this message Email this Topic

Edit this Topic
  
 
 
Forums Statistics

About Sun forums
  • Oracle Forums is a large collection of user generated discussions. It is here to help you ask questions, find answers, and participate in discussions.

    Check out our guide on Getting started with Oracle Forums for a full walkthrough of how to best leverage the benefits of this community.

Powered by Jive Forums