LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 03-07-2006, 12:47 PM   #1
spicyed
LQ Newbie
 
Registered: Jan 2006
Location: New Jersey
Distribution: Fedora Core 4, Slackware 10.2
Posts: 29

Rep: Reputation: 15
Good tutorials for gui programming?


I'm looking to start creating gtk gui's, but I'm having a lot of trouble getting started.

I'm programming in c++, using the Anjuta IDE and Glade to create the GUI. I'm able to code a basic program and gui the the point where it should compile, however I have so many problems with the compiler not being able to find libraries. (gtkmm or libgnomeuimm depending on what type I chose)

What do I have to do to get the compiler to use gtk properly? (In anjuta)
 
Old 03-07-2006, 05:13 PM   #2
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

1. Personally, I use the raw GTK+ C API, even in my C++ programs.

I'm certainly not saying you should do the same. But I *am* saying
that you don't necessarily have to use gtkmm just because you want
to program in C++... and not using gtkmm is just one less thing
that can go wrong...

2. I found the GTK+ tutorial very useful (but of course, it's oriented
toward the GTK+ C API, and it doesn't use the GUI builder):

http://www.gtk.org/tutorial/

3. Finally, and most important - please cut/paste the build command
you're running, and the resulting compile errors you're getting.

The folks here at LQ would be VERY happy to help you fix whatever
problems you're encountering!

Your .. PSM
 
Old 03-07-2006, 11:42 PM   #3
spicyed
LQ Newbie
 
Registered: Jan 2006
Location: New Jersey
Distribution: Fedora Core 4, Slackware 10.2
Posts: 29

Original Poster
Rep: Reputation: 15
Well my problem all stems from not being able to access gtkmm or gnome resources.

Anjuta runs :
Quote:
g++ 'gnome-config --cflags gnomemm' -Wall -g -c 'test6.cc' -o 'test6.o'


And I get the following errors:

Quote:
g++: gnome-config --cflags gnomemm: No such file or directory
test6.cc:8:20: error: config.h: No such file or directory
test6.cc:9:26: error: gnome--/main.h: No such file or directory
test6.cc:10:24: error: glib/gi18n.h: No such file or directory
In file included from window1.hh:13,
from test6.cc:12:
window1_glade.hh:21:30: error: gtkmm/accelgroup.h: No such file or directory
window1_glade.hh:39:26: error: gtkmm/window.h: No such file or directory
window1_glade.hh:26: error: ‘Glib’ has not been declared
window1_glade.hh:26: error: ISO C++ forbids declaration of ‘RefPtr’ with no typewindow1_glade.hh:26: error: expected ‘;’ before ‘<’ token
window1_glade.hh:29: error: ‘Glib’ has not been declared
window1_glade.hh:29: error: expected `)' before ‘<’ token
window1_glade.hh:33: error: ‘Glib’ has not been declared
window1_glade.hh:33: error: ISO C++ forbids declaration of ‘RefPtr’ with no typewindow1_glade.hh:33: error: expected ‘;’ before ‘<’ token
window1_glade.hh:36: error: expected `;' before ‘}’ token
window1_glade.hh:41: error: ‘Gtk’ has not been declared
window1_glade.hh:42: error: expected class-name before ‘{’ token
window1_glade.hh:46: error: ‘Gtk’ has not been declared
test6.cc: In function ‘int main(int, char**)’:
test6.cc:22: error: ‘Gnome’ has not been declared
test6.cc:22: error: ‘Main’ was not declared in this scope
test6.cc:22: error: expected `;' before ‘m’
test6.cc:25: error: ‘m’ was not declared in this scope
I believe that the only thing I need to fix would be to properly link to gtkmm. Though I have had no success with that.

EDIT: I also realize that the code is for gtk but it's compiling for gnome which makes no difference I get the same errors when I try to compile with gtk.

Last edited by spicyed; 03-07-2006 at 11:50 PM.
 
Old 03-08-2006, 12:09 AM   #4
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Have you tried "apt-get install gnomemm-devel"?

I don't know anything about "apt": I use SuSE, and SuSE uses "yast". But I believe that's the right command. And I also believe it will notify you of any dependencies (like gtk-devel, for example) that you need but don't have.

Anyway, I hope that helps!
 
Old 03-08-2006, 01:54 AM   #5
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Quote:
Originally Posted by paulsm4
Have you tried "apt-get install gnomemm-devel"?

I don't know anything about "apt": I use SuSE, and SuSE uses "yast". But I believe that's the right command. And I also believe it will notify you of any dependencies (like gtk-devel, for example) that you need but don't have.

Anyway, I hope that helps!
You use yum on Fedora Core, but I don't know the syntax. apt-get is for Debian and derivatives .
 
Old 03-08-2006, 02:32 AM   #6
spicyed
LQ Newbie
 
Registered: Jan 2006
Location: New Jersey
Distribution: Fedora Core 4, Slackware 10.2
Posts: 29

Original Poster
Rep: Reputation: 15
Apt can be used, but its depreciated. I found one package I didn't have (libgnomeuimm26-devel), but that will not fix my problem. :-\
 
Old 03-08-2006, 11:05 AM   #7
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

Thanx again for posting the errors: it definitely helps!

Here are a couple of different suggestions:

1. Quotes vs back-quotes:
I'm concerned about this:
Quote:
g++ 'gnome-config --cflags gnomemm' -Wall -g -c 'test6.cc' -o 'test6.o'
It should really say this:
Quote:
g++ `gnome-config --cflags gnomemm` -Wall -g -c 'test6.cc' -o 'test6.o'
Do you have any idea what might account for the discrepency?

2. Is gnome-config (or gtk-config or pkg-config) really installed/configured?
Please try it from the command line
EXAMPLES:
Quote:
gnome-config --version
Quote:
gnome-config --cflags gnomemm
Quote:
pkg-config --list-all
3. Please post back what you find.

Good luck!

PS:
"apt", "yum", "yast" - you can ALWAYS fall back on "rpm"!

PPS:
Speaking of which: it might not hurt to try this, too:
Quote:
rpm -qa |grep -i gtk

Last edited by paulsm4; 03-08-2006 at 11:08 AM.
 
  


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
Programming Tutorials cipicip Programming 4 01-04-2006 05:06 AM
Programming in Java, looking for a good place on the web for tutorials or books.... jmax24 Programming 3 04-18-2004 04:18 AM
Svga-lib C programming tutorials WindowsBurner Programming 25 11-10-2003 04:25 AM
looking for programming tutorials / books, etc markus1982 Programming 18 03-12-2003 04:33 AM
Good Tutorials? RedHatMN Linux - Newbie 5 10-23-2001 07:25 AM


All times are GMT -5. The time now is 04:59 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration