LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 07-18-2008, 11:42 AM   #1
Ian D
Member
 
Registered: Aug 2005
Location: Solihull, UK
Distribution: Fedora 9
Posts: 127

Rep: Reputation: 15
Compiling Programs


Some time ago I wrote a program and compiled it successfully (on a machine running FC4).

Now I have Fedora 9 and I want to recompile the program - but I can't remember all that I did. Here is the result of my attempt.

Code:
[Ian@localhost sourceETR]$ gcc *.cc
In file included from ElTimeBody.cc:15:
ElTimeBody.h:14:19: error: gtkmm.h: No such file or directory
In file included from ElTimeBody.cc:15:
ElTimeBody.h:17: error: ‘Gtk’ has not been declared
ElTimeBody.h:17: error: expected `{' before ‘Window’
ElTimeBody.h:17: error: function definition does not declare parameters
ElTimeBody.cc:20: error: invalid use of incomplete type ‘class ElapsedTime’
ElTimeBody.h:17: error: forward declaration of ‘class ElapsedTime’
ElTimeBody.cc:42: error: invalid use of incomplete type ‘class ElapsedTime’
ElTimeBody.h:17: error: forward declaration of ‘class ElapsedTime’
ElTimeBody.cc:48: error: invalid use of incomplete type ‘class ElapsedTime’
ElTimeBody.h:17: error: forward declaration of ‘class ElapsedTime’
ElTimemain.cc:11:24: error: gtkmm/main.h: No such file or directory
In file included from ElTimemain.cc:12:
ElTimeBody.h:14:19: error: gtkmm.h: No such file or directory
In file included from ElTimemain.cc:12:
ElTimeBody.h:17: error: ‘Gtk’ has not been declared
ElTimeBody.h:17: error: expected `{' before ‘Window’
ElTimeBody.h:17: error: function definition does not declare parameters
ElTimemain.cc: In function ‘int main(int, char**)’:
ElTimemain.cc:19: error: ‘Gtk’ has not been declared
ElTimemain.cc:19: error: expected `;' before ‘kit’
ElTimemain.cc:23: error: aggregate ‘ElapsedTime ElapsedTime’ has incomplete type and cannot be defined
ElTimemain.cc:30: error: ‘Gtk’ has not been declared
[Ian@localhost sourceETR]$
I remember that gtk came into the process previously. Is there someone who could jog my memory - I have installed gtk-devel.

TIA
 
Old 07-18-2008, 11:57 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Looks like you need to install gtkmm (C++ bindings to GTK+). I don't know whether Fedora has packages for it, but of course you can install it from source. You should also use g++ for compiling C++ programs and you'll need to link gtkmm (see the documentation for it to see which flags to use).

Last edited by Nylex; 07-18-2008 at 11:59 AM.
 
Old 07-18-2008, 12:28 PM   #3
Ian D
Member
 
Registered: Aug 2005
Location: Solihull, UK
Distribution: Fedora 9
Posts: 127

Original Poster
Rep: Reputation: 15
I do have gtkmm24 and gtkmm24-devel installed. Is there something more I need? (or might I need to update my code?)
 
Old 07-18-2008, 12:39 PM   #4
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
You need to tell the compiler where to find the headers and the libraries. Using "`pkg-config gtkmm-2.4 --cflags --libs`" when you run g++ will include all the relevant compiler options (see sections 1 and 2 of http://gtkmm.org/docs/gtkmm-2.4/docs...er-basics.html).
 
Old 07-18-2008, 01:09 PM   #5
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 172Reputation: 172
Do you have gtk+-devel(note the +)?
 
Old 07-19-2008, 03:37 AM   #6
Ian D
Member
 
Registered: Aug 2005
Location: Solihull, UK
Distribution: Fedora 9
Posts: 127

Original Poster
Rep: Reputation: 15
Thank you Nylex - that link certainly helped me. It also gave me the information I needed to make the enhancements I had planned.

Thank you Lazlow - I had not installed gtk+-devel (or gtk+).

It's great to have people you can ask.
 
  


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
Compiling C Programs moserbear Linux - Newbie 7 09-20-2007 08:39 PM
Compiling Programs Faxanadu Linux - Software 3 05-30-2005 02:51 AM
Compiling C++ programs rchillal Linux - Newbie 13 02-08-2005 06:27 AM
compiling programs disorderly Linux - Newbie 2 10-17-2003 01:48 PM
Compiling Programs Jabber63 Linux - Software 3 08-06-2003 03:58 AM


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

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