gtkmm help
Hi! I'm having trouble compiling a very simple gtkmm application. I'm new to gtkmm. I have a class named HelloWorld. It is a window with a button. There are 3 files: helloworld.h, helloworld.cc, main.cc. I can't seem to compile helloworld.cc. Here's how I tried to compile it (not linking yet):
g++ -o helloworld.o -c helloworld.cc `pkg-config gtkmm-2.4 --cflags` I get this message: helloworld.cc:6: error: `Helloworld' has not been declared helloworld.cc:7: error: ISO C++ forbids declaration of `Helloworld' with no type helloworld.cc: In function `int Helloworld()': helloworld.cc:7: error: only constructors take base initializers helloworld.cc:9: error: `set_border_width' undeclared (first use this function) helloworld.cc:9: error: (Each undeclared identifier is reported only once for each function it appears in.) helloworld.cc:10: error: `m_button' undeclared (first use this function) helloworld.cc:10: error: invalid use of `this' in non-member function helloworld.h:13: error: `virtual void HelloWorld::on_button_clicked()' is protected helloworld.cc:10: error: within this context helloworld.cc:11: error: `add' undeclared (first use this function) Here's my code. helloworld.h Code:
#include <gtkmm/button.h> helloworld.cc Code:
#include "helloworld.h" main.cc Code:
#include <gtkmm/main.h> |
C++ is case sensitive.
HelloWorld != Helloworld |
All times are GMT -5. The time now is 02:23 PM. |