LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-07-2004, 07:48 PM   #1
doody
LQ Newbie
 
Registered: Aug 2004
Distribution: Slackware
Posts: 28

Rep: Reputation: 15
Help finishing upgrade of gtk


Well, I've learned a lot in the short time I've been using slack but now I'm sort of stumped =(

I downloaded the new version of gtk+ and everything installed fine. The examples work fine, etc. Also, I downloaded/installed mesa (which is working fine), and gtkglext. Now, I was able to use the include makefile (make examples) to compile the gtkglext examples, and they work great. But for the life of me I cannot figure out how to compile them manually.

I have looked in the makefile for gtkgltext and I see that it is linking directly with the new version of gtk 2 (in fact, i know gtk 2 installed ok because gtkglext won't work without it!). I made a backup of the gtk-config file and replaced certain lines with ones I found in the makefile, but when I try to compile I get a lot of "undefined" errors, which I know means something isn't being linked right. However, I know that the sources _can_ be compiled with the libraries I have on my system, simply because the make file was able to do so!

But I am seriously stumped as to how and fix this. I mean afterall, I'm eventually going to want to compile my own gtkglext sources. Please help!

- Stephen

EDIT:

Here is a link to an image of the makefile output:image

Last edited by doody; 09-07-2004 at 08:46 PM.
 
Old 09-07-2004, 10:19 PM   #2
doody
LQ Newbie
 
Registered: Aug 2004
Distribution: Slackware
Posts: 28

Original Poster
Rep: Reputation: 15
OK, Well here is how I am trying to compile:

gcc gears.c -o bleh `pkg-config --libs gtk+-2.0` `pkg-config --cflags gtk+-2.0` -I/usr/X11R6/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/atk-1.0

Which gives me this error:

gears.c:18:23: gtk/gtkgl.h: No such file or directory
gears.c: In function `draw':
gears.c:174: error: `GdkGLContext' undeclared (first use in this function)
gears.c:174: error: (Each undeclared identifier is reported only once
gears.c:174: error: for each function it appears in.)
gears.c:174: error: `glcontext' undeclared (first use in this function)
gears.c:175: error: `GdkGLDrawable' undeclared (first use in this function)
gears.c:175: error: `gldrawable' undeclared (first use in this function)
gears.c: In function `reshape':
gears.c:237: error: `GdkGLContext' undeclared (first use in this function)
gears.c:237: error: `glcontext' undeclared (first use in this function)
gears.c:238: error: `GdkGLDrawable' undeclared (first use in this function)
gears.c:238: error: `gldrawable' undeclared (first use in this function)
gears.c: In function `init':
gears.c:264: error: `GdkGLContext' undeclared (first use in this function)
gears.c:264: error: `glcontext' undeclared (first use in this function)
gears.c:265: error: `GdkGLDrawable' undeclared (first use in this function)
gears.c:265: error: `gldrawable' undeclared (first use in this function)
gears.c: In function `main':
gears.c:434: error: `GdkGLConfig' undeclared (first use in this function)
gears.c:434: error: `glconfig' undeclared (first use in this function)
gears.c:468: error: `GDK_GL_MODE_RGB' undeclared (first use in this function)
gears.c:469: error: `GDK_GL_MODE_DEPTH' undeclared (first use in this function)
gears.c:470: error: `GDK_GL_MODE_DOUBLE' undeclared (first use in this function)
gears.c:519: error: `GDK_GL_RGBA_TYPE' undeclared (first use in this function)


So, I found out where gtkgl.h was hiding and add this to the compile options:

-I/usr/local/lib/gtkglext-1.0/include/

And now I get this:

/tmp/cc6qG1kh.o(.text+0x54): In function `gear':
: undefined reference to `glShadeModel'
/tmp/cc6qG1kh.o(.text+0x71): In function `gear':
: undefined reference to `glNormal3f'
/tmp/cc6qG1kh.o(.text+0x7e): In function `gear':
: undefined reference to `glBegin'
/tmp/cc6qG1kh.o(.text+0xd6): In function `gear':
: undefined reference to `sin'
/tmp/cc6qG1kh.o(.text+0xfb): In function `gear':
: undefined reference to `cos'
/tmp/cc6qG1kh.o(.text+0x10d): In function `gear':
: undefined reference to `glVertex3f'
/tmp/cc6qG1kh.o(.text+0x13a): In function `gear':
: undefined reference to `sin'
/tmp/cc6qG1kh.o(.text+0x15f): In function `gear':
: undefined reference to `cos'
/tmp/cc6qG1kh.o(.text+0x171): In function `gear':
: undefined reference to `glVertex3f'


etc etc etc...

I tried adding -lglut but it didnt help! I am extremely lost with how to get this work... I'm trying hard to figure it out and I really need help. I know whatever the makefile is doing is what I need to be doing, so here is a link to the entire makefile:

makefile


Oh, and *BUMP* =)

- Stephen
 
Old 09-08-2004, 12:59 AM   #3
doody
LQ Newbie
 
Registered: Aug 2004
Distribution: Slackware
Posts: 28

Original Poster
Rep: Reputation: 15
Making some progress here (finally). I now can simply do:

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

to get to this error:

/tmp/ccqnlR9y.o(.text+0x59): In function `realize':
: undefined reference to `gtk_widget_get_gl_context'
/tmp/ccqnlR9y.o(.text+0x6a): In function `realize':
: undefined reference to `gdk_gl_drawable_get_type'
/tmp/ccqnlR9y.o(.text+0x76): In function `realize':
: undefined reference to `gtk_widget_get_gl_window'
/tmp/ccqnlR9y.o(.text+0x117): In function `realize':
: undefined reference to `gdk_gl_drawable_gl_begin'
/tmp/ccqnlR9y.o(.text+0x140): In function `realize':
: undefined reference to `glClearColor'
/tmp/ccqnlR9y.o(.text+0x157): In function `realize':
: undefined reference to `glClearDepth'


I think there is something i need to link into these apps, but I'm having trouble finding out what. If anyone has used gtkglext please help me.

- Stephen

btw, i have unistalled gtk 1.2 and 2.0, and then reinstalld 2.0 from binaries. i dont know if i should have done this though... im having trouble compiling the gtk examples manually as well. however, gtk-demo works, as well as the other examples (which tells me gtk is installed correctly.. and that my brain is stuck on stupid)..
 
Old 09-08-2004, 05:43 AM   #4
mhearn
LQ Guru
 
Registered: Nov 2002
Location: Durham, England
Distribution: Fedora Core 4
Posts: 1,565

Rep: Reputation: 47
Add -lgl -lgtkglext (or whatever) to the link line, see if that helps.
 
Old 09-08-2004, 11:54 AM   #5
doody
LQ Newbie
 
Registered: Aug 2004
Distribution: Slackware
Posts: 28

Original Poster
Rep: Reputation: 15
Well, this is where I'm at now:

gcc button.c -lGL -lpthread -L/usr/X11R6/lib `gtk-config --libs --cflags` -L/usr/local/include/gtkglext-1.0/ -o bleh

the /usr/X11R6/lib is where my libglu.so file is at, and the /usr/local/.../gtkglext-1.0 is where all of the gtkglext header files are at. This is the error I'm getting:

button.c:13:23: gtk/gtkgl.h: No such file or directory
button.c: In function `realize':
button.c:34: error: `GdkGLContext' undeclared (first use in this function)
button.c:34: error: (Each undeclared identifier is reported only once
button.c:34: error: for each function it appears in.)
button.c:34: error: `glcontext' undeclared (first use in this function)
button.c:35: error: `GdkGLDrawable' undeclared (first use in this function)
button.c:35: error: `gldrawable' undeclared (first use in this function)
button.c: In function `configure_event':
button.c:68: error: `GdkGLContext' undeclared (first use in this function)
button.c:68: error: `glcontext' undeclared (first use in this function)
button.c:69: error: `GdkGLDrawable' undeclared (first use in this function)
button.c:69: error: `gldrawable' undeclared (first use in this function)
button.c: In function `expose_event':
button.c:107: error: `GdkGLContext' undeclared (first use in this function)
button.c:107: error: `glcontext' undeclared (first use in this function)
button.c:108: error: `GdkGLDrawable' undeclared (first use in this function)
button.c:108: error: `gldrawable' undeclared (first use in this function)
button.c: In function `timeout':
button.c:155: error: `G_PI' undeclared (first use in this function)
button.c: At top level:
button.c:254: error: parse error before '*' token
button.c: In function `create_gl_toggle_button':
button.c:277: error: `glconfig' undeclared (first use in this function)
button.c:280: error: `GDK_GL_RGBA_TYPE' undeclared (first use in this function)
button.c: In function `main':
button.c:329: error: `GdkGLConfig' undeclared (first use in this function)
button.c:329: error: `glconfig' undeclared (first use in this function)
button.c:350: error: `GDK_GL_MODE_RGB' undeclared (first use in this function)
button.c:351: error: `GDK_GL_MODE_DEPTH' undeclared (first use in this function)
button.c:352: error: `GDK_GL_MODE_DOUBLE' undeclared (first use in this function)


I don't understand why it's telling me it cant find gtk/gtkgl.h. I know it is in that directory because I'm looking right at it... I wish I could figure out how the makefile is compiling the examples, but it makes absolutely no sense to me.

- Stephen
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Upgrade to Gtk 2.6 but keep my old Gtk 2.0? rylan76 Linux - Software 6 06-13-2005 12:29 AM
why can't i upgrade gtk+ kryptonite0110 Linux - Software 7 03-21-2005 09:56 PM
X issues following GTK upgrade TakeAwayDave Linux - Software 0 07-22-2004 09:09 AM
Finishing up KDE 3.2 upgrade amw2320 Slackware 1 05-17-2004 04:08 PM
How do I upgrade GTK+ from 1.2.8 to 2.2.4 under Mandrake 7.2 paragon17 Linux - Software 4 04-28-2004 08:08 AM


All times are GMT -5. The time now is 10:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration