1825605 Members
2857 Online
109682 Solutions
New Discussion

gtk+

 
Norman_21
Honored Contributor

gtk+

The compiler can't seem to find the gtk, any ideas?

HPITHA1/usr/src/dx_chkpasswd > ls -lart
total 96
-rwx------ 1 root sys 231 Dec 11 2002 deploy.sh
-rw-r----- 1 root sys 694 Apr 9 2003 dx_chkpasswd.c
-rw-rw---- 1 root sys 4978 Apr 9 2003 dx_chkpasswd_glib.c
-rw-rw---- 1 root sys 477 Apr 9 2003 Makefile
drwxr-x--- 2 root sys 8192 Apr 9 2003 gtk
drwxr-xr-x 3 root sys 96 Apr 19 15:42 ..
drwxrwx--- 3 root sys 8192 Apr 19 15:43 .
HPITHA1/usr/src/dx_chkpasswd > ll gtk
total 96
-rw-rw---- 1 root sys 152 Apr 9 2003 Makefile
-rw-rw---- 1 root sys 1214 Apr 9 2003 gtk.h
-rw-rw---- 1 root sys 6224 Apr 9 2003 gtkmain.c
-rw-rw---- 1 root sys 2031 Apr 9 2003 gtkmain.h
-rw-r----- 1 root sys 5962 Apr 9 2003 gtkmain.o
-rw-rw---- 1 root sys 1507 Apr 9 2003 gtktypeutils.h
HPITHA1/usr/src/dx_chkpasswd > echo $SHLIB_PATH
/usr/src/dx_chkpasswd/gtk
HPITHA1/usr/src/dx_chkpasswd > ls -lart
HPITHA1/usr/src/dx_chkpasswd > echo $CC
/usr/local/bin/gcc
HPITHA1/usr/src/dx_chkpasswd > echo $SHLIB_PATH
/usr/src/dx_chkpasswd/gtk
HPITHA1/usr/src/dx_chkpasswd > /usr/local/bin/gcc -v
Using built-in specs.
Target: ia64-hp-hpux11.23
Configured with: ../gcc/configure
Thread model: posix
gcc version 4.2.3
HPITHA1/usr/src/dx_chkpasswd > /usr/local/bin/gcc dx_chkpasswd_glib.c
dx_chkpasswd_glib.c:1:21: error: gtk/gtk.h: No such file or directory
dx_chkpasswd_glib.c:18: error: expected specifier-qualifier-list before 'gint'
dx_chkpasswd_glib.c:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'my_timeout'
dx_chkpasswd_glib.c:37: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'my_io_in'
dx_chkpasswd_glib.c:74: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'my_io_err'
dx_chkpasswd_glib.c:84: error: expected ')' before 'data'
dx_chkpasswd_glib.c:120: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'my_init'
dx_chkpasswd_glib.c:167: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'my_exit'
dx_chkpasswd_glib.c: In function 'main':
dx_chkpasswd_glib.c:205: error: 'my_init' undeclared (first use in this function)
dx_chkpasswd_glib.c:205: error: (Each undeclared identifier is reported only once
dx_chkpasswd_glib.c:205: error: for each function it appears in.)
dx_chkpasswd_glib.c:207: error: 'my_exit' undeclared (first use in this function)
dx_chkpasswd_glib.c:212: error: 'my_GlobalVars' has no member named 'rc'
"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003
22 REPLIES 22
James R. Ferguson
Acclaimed Contributor

Re: gtk+

Hi:

Is GTK installed? On an 11.31 server of mine:

# swlist|grep -i gtk
B6848BA 1.4.gm.46.16 Ximian GNOME 1.4 GTK+ Libraries for HP-UX
GTK 2.6.8.00.01 GTK+ 2.6 The Gnome GUI Runtime Toolkit
#

# find /opt -type f -name gtk.h
/opt/gnome/include/gtk-1.2/gtk/gtk.h
/opt/gnome/src/GTK+/gtk+-1.2.10/gtk/gtk.h
/opt/gtk2.6/include/gtk-2.0/gtk/gtk.h
#

Regards!

...JRF...
Norman_21
Honored Contributor

Re: gtk+

yes, it is installed but the compiler can't seem to locate the directory? Is there a variable that I need to set?
"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003
Steven E. Protter
Exalted Contributor

Re: gtk+

Shalom,

Check your PATH, SHLIB_PATH and sd/ux

If you do not have gtk+ software it is available at http://www.hp.com/go/firefox

It is probably also available elsewhere but definitely at the link above as it is a pre-requisite for firefox.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Dennis Handly
Acclaimed Contributor

Re: gtk+

>it is installed but the compiler can't seem to locate the directory? Is there a variable that I need to set?

You need to use -I to point the compiler to the include directory. Assuming you used find(1) like JRF did, it would be one of these:
-I/opt/gnome/include/gtk-1.2
-I/opt/gnome/src/GTK+/gtk+-1.2.10
-I/opt/gtk2.6/include/gtk-2.0

>SEP: Check your PATH, SHLIB_PATH

These won't help at compile time.
Norman_21
Honored Contributor

Re: gtk+

Dennis,

Thanks for the info. It appears that the gkt/gtk.h is in the source file which causes the "No such file or directory" error msg. However, even with the "-l" I still get the error.

HPITHA1/usr/src > export CC=gcc
HPITHA1/usr/src > gcc -v
Using built-in specs.
Target: ia64-hp-hpux11.23
Configured with: ../gcc/configure
Thread model: posix
gcc version 4.2.3

/usr/src/dx_chkpasswd > gcc -l/opt/gnome/include/gtk-1.2/gtk dx_chkpasswd_glib.c -o dx_chkpasswd_glib.ex>
dx_chkpasswd_glib.c:1:21: error: gtk/gtk.h: No such file or directory
dx_chkpasswd_glib.c:18: error: expected specifier-qualifier-list before 'gint'
dx_chkpasswd_glib.c:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'my_timeout'
dx_chkpasswd_glib.c:37: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'my_io_in'
dx_chkpasswd_glib.c:74: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'my_io_err'
dx_chkpasswd_glib.c:84: error: expected ')' before 'data'
dx_chkpasswd_glib.c:120: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'my_init'
dx_chkpasswd_glib.c:167: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'my_exit'
dx_chkpasswd_glib.c: In function 'main':
dx_chkpasswd_glib.c:205: error: 'my_init' undeclared (first use in this function)
dx_chkpasswd_glib.c:205: error: (Each undeclared identifier is reported only once
dx_chkpasswd_glib.c:205: error: for each function it appears in.)
dx_chkpasswd_glib.c:207: error: 'my_exit' undeclared (first use in this function)
dx_chkpasswd_glib.c:212: error: 'my_GlobalVars' has no member named 'rc'

/usr/src/dx_chkpasswd>head dx_chkpasswd_glib.c
#include

#include
#include
#include
#include
#include
#include
#include

Any ideas?
"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003
James R. Ferguson
Acclaimed Contributor

Re: gtk+

Hi (again):

You specified the include directory as Dennis noted and did:

> gcc -l/opt/gnome/include/gtk-1.2/gtk

...but then in your source you specified:

> #include

I think you need, simply:

#include

...or:

# gcc -l/opt/gnome/include/gtk-1.2

...without the next directory.

Regards!

...JRF...


Regards!

...JRF...

Norman_21
Honored Contributor

Re: gtk+

James

I tried both methods with no luck. I'm beginning to think the errors aren't relative to gtk and perhaps something the source code needs adjustment. It was built by a programmer on 2003 who is no longer with us and we need to compile it for Itaniums. So your help will be highly appreciated!
I'm attaching the source code for your review and here is the output from the last attempt that has no gtk.h in the source code and rather using the "-l" to point the compiler:

/usr/src/dx_chkpasswd > /usr/local/bin/gcc -l/opt/gtk2.6/include/gtk-2.0 dx_chkpasswd_glib.c -o dx_chkpasswd_glib.exe
dx_chkpasswd_glib.c:16: error: expected specifier-qualifier-list before 'gint'
dx_chkpasswd_glib.c:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'my_timeout'
dx_chkpasswd_glib.c:35: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'my_io_in'
dx_chkpasswd_glib.c:72: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'my_io_err'
dx_chkpasswd_glib.c:82: error: expected ')' before 'data'
dx_chkpasswd_glib.c:118: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'my_init'
dx_chkpasswd_glib.c:165: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'my_exit'
dx_chkpasswd_glib.c: In function 'main':
dx_chkpasswd_glib.c:203: error: 'my_init' undeclared (first use in this function)
dx_chkpasswd_glib.c:203: error: (Each undeclared identifier is reported only once
dx_chkpasswd_glib.c:203: error: for each function it appears in.)
dx_chkpasswd_glib.c:205: error: 'my_exit' undeclared (first use in this function)
dx_chkpasswd_glib.c:210: error: 'my_GlobalVars' has no member named 'rc'
"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003
Dennis Handly
Acclaimed Contributor

Re: gtk+

>It appears that the gkt/gtk.h is in the source file which causes the "No such file or directory" error msg. However, even with the "-l" I still get the error.
>gcc -l/opt/gnome/include/gtk-1.2/gtk

That's -I, not -l or -1. You need to cut&paste examples, not type by sight. Also, you added an extra path to the end.

>I'm attaching the source code for your review and here is the output from the last attempt that has no gtk.h in the source code

Why would you want to remove that header that defines gint?

>JRF: I think you need, simply: #include

You should use the documented include style and leave it alone and put the paths as I specified. Note: google finds it with gdk/gdk.h. (With the right option letter. :-)
Norman_21
Honored Contributor

Re: gtk+

Thanks for the tips Dennis but now I'm getting another error with glib.h, any thoughts?
see attached output.
"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003
Norman_21
Honored Contributor

Re: gtk+

Sorry, I attached the wrong file in the previous thread so here is the good one?
"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003
Dennis Handly
Acclaimed Contributor

Re: gtk+

>I'm getting another error with glib.h, any thoughts?

Where is glib.h? Try doing JRF's find for this file.
Have you downloaded all of GTK's dependencies?
Norman_21
Honored Contributor

Re: gtk+

I'm getting close Dennis. I kept adding more paths whenever I encounter a path error so that fixed the pathing issue but we have another problem "unsatisfied symbol": I'm posting the command I used and the final output:

gcc -I/opt/gnome/include/gtk-1.2 -I/opt/gnome/include/glib-1.2 -I/opt/gnome/lib/glib/include dx_chkpasswd_glib.c -o chkpasswd.exe
ld: Unsatisfied symbol "g_io_add_watch" in file /var/tmp//cc5CqsFn.o
ld: Unsatisfied symbol "g_source_remove" in file /var/tmp//cc5CqsFn.o
ld: Unsatisfied symbol "g_strndup" in file /var/tmp//cc5CqsFn.o
ld: Unsatisfied symbol "g_free" in file /var/tmp//cc5CqsFn.o
ld: Unsatisfied symbol "gtk_main" in file /var/tmp//cc5CqsFn.o
ld: Unsatisfied symbol "gtk_init_add" in file /var/tmp//cc5CqsFn.o
ld: Unsatisfied symbol "gtk_quit_add" in file /var/tmp//cc5CqsFn.o
ld: Unsatisfied symbol "g_io_add_watch_full" in file /var/tmp//cc5CqsFn.o
ld: Unsatisfied symbol "g_timeout_add" in file /var/tmp//cc5CqsFn.o
ld: Unsatisfied symbol "g_io_channel_read_line" in file /var/tmp//cc5CqsFn.o
ld: Unsatisfied symbol "g_io_channel_unix_new" in file /var/tmp//cc5CqsFn.o
ld: Unsatisfied symbol "gtk_main_quit" in file /var/tmp//cc5CqsFn.o
12 errors.
collect2: ld returned 1 exit status

BTW: all of the dependencies are installed.
"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003
Dennis Handly
Acclaimed Contributor

Re: gtk+

>we have another problem "unsatisfied symbol"

Can you scan the source for one of these symbols?
And/or scan the objects/libs:
nm -pxAN objects ... libs ... | grep g_io_add_watch
Norman_21
Honored Contributor

Re: gtk+

Dennis

If I'm not mistaken, there are some missing libraries "cannot open", Correct? I'm not really sure what to look for from the output so can you please advice?
The source code returned bad magic so I assume its not the issue.

nm -pxAN /usr/lib/lib* | grep g_io_add_watch
nm: /usr/lib/lib.b: bad magic
nm: /usr/lib/libU77.alias: bad magic
nm: /usr/lib/libU77.alias.i8: bad magic
nm: /usr/lib/libU77.alias.r8: bad magic
nm: /usr/lib/libU77_.alias: bad magic
nm: /usr/lib/libbomb.a: cannot open
nm: /usr/lib/libemc_crypto.sl: cannot open
nm: /usr/lib/libemc_ssl.sl: cannot open
nm: /usr/lib/libvrascmd.sl: cannot open
"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003
Dennis Handly
Acclaimed Contributor

Re: gtk+

>there are some missing libraries "cannot open", Correct?

Perhaps. What does ll(1) show for each?

>The source code returned bad magic so I assume it's not the issue.

You need to use something like grep for source.

>nm -pxAN /usr/lib/lib* | grep g_io_add_watch
>nm: /usr/lib/libemc_crypto.sl: cannot open
>nm: /usr/lib/libemc_ssl.sl: cannot open
>nm: /usr/lib/libvrascmd.sl: cannot open

(Are these symlinks and to what?)

Have you looked for libs that you have just built?

Do you have archive libs on your link line?
If you haven't ordered them properly, you may need to use -Wl,+n.
Norman_21
Honored Contributor

Re: gtk+

here is the "ll" output. no luck yet...

ll /usr/lib/lib.b
-r-xr-xr-x 1 bin bin 1656 Aug 26 2004 /usr/lib/lib.b
ll /usr/lib/libU77.alias
-r--r--r-- 1 bin bin 1687 Jun 2 2004 /usr/lib/libU77.alias
ll /usr/lib/libU77.alias.i8
-r--r--r-- 1 bin bin 1745 Aug 17 2004 /usr/lib/libU77.alias.i8
ll /usr/lib/libU77.alias.r8
-r--r--r-- 1 bin bin 1689 Jun 2 2004 /usr/lib/libU77.alias.r8
ll /usr/lib/libU77_.alias
-r--r--r-- 1 bin bin 1741 Jun 2 2004 /usr/lib/libU77_.alias
ll /usr/lib/libbomb.a
lrwxrwxrwt 1 root sys 22 Jul 13 2007 /usr/lib/libbomb.a -> /opt/dce/lib/libbomb.a
ll /opt/dce/lib/libbomb.a
/opt/dce/lib/libbomb.a not found
ll /usr/lib/libemc_ssl.sl
lrwxr-xr-x 1 root sys 37 Jul 13 2007 /usr/lib/libemc_ssl.sl -> /usr/symcli/shlib/libemc_ssl.sl.0.9.7
"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003
Dennis Handly
Acclaimed Contributor

Re: gtk+

>here is the "ll" output. no luck yet...
>ll /usr/lib/lib.b

No need to look at the "bad magic" ones.

>lrwxrwxrwt /usr/lib/libbomb.a -> /opt/dce/lib/libbomb.a

And you don't have /opt/dce.

Have you scanned your gtk+ sources for those symbols?
Norman_21
Honored Contributor

Re: gtk+

Would you mind to give an example?
"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003
Dennis Handly
Acclaimed Contributor

Re: gtk+

>Would you mind to give an example?

Of grep?? Using find(1) to be recursive:
find /path-to-search ... -type f -name "*.[CHch]*" \
-exec grep -e g_io_add_watch {} +

For a simple directory:
grep -e g_io_add_watch *.[CHch]*
Dennis Handly
Acclaimed Contributor

Re: gtk+

Here is a tool "ack" that searches: http://betterthangrep.com/
Norman_21
Honored Contributor

Re: gtk+

Sorry, I missed interpret your question about the search "find".
Here is the result attached.
"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003
Dennis Handly
Acclaimed Contributor

Re: gtk+

>Here is the result attached.

I'm not sure why I want that. That's for you to do data reduction and come to a conclusion.
I.e. which files are uses, which are declarations and which are definitions. It is the latter we want.
A quick scan gives:
giochannel.c: g_io_add_watch
glib.h: guint g_io_add_watch
giochannel.h: guint g_io_add_watch
dx_chkpasswd_glib.c: p->io_tag = g_io_add_watch

So where is your giochannel.o or glib?