LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Compiling Programs (https://www.linuxquestions.org/questions/linux-newbie-8/compiling-programs-656644/)

Ian D 07-18-2008 10:42 AM

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

Nylex 07-18-2008 10:57 AM

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

Ian D 07-18-2008 11:28 AM

I do have gtkmm24 and gtkmm24-devel installed. Is there something more I need? (or might I need to update my code?)

Nylex 07-18-2008 11:39 AM

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

lazlow 07-18-2008 12:09 PM

Do you have gtk+-devel(note the +)?

Ian D 07-19-2008 02:37 AM

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.


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