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