[gtkmm] help getting "hello world" to build



I was very happy to find the gtkmm2 and libsigc++ rpms

gtkmm2-2.2.1-fr1.i386.rpm
gtkmm2-devel-2.2.1-fr1.i386.rpm
libsigc++-1.2.4-fr1.i386.rpm
libsigc++-devel-1.2.4-fr1.i386.rpm

up on http://shrike.freshrpms.net/ and promptly installed
them on my RH9 system. I'm brand-new to gtkmm.


I can't get the following program to build:

---------------------snip-----------------
#include <gtkmm.h>

int main( int argc, char * argv[] )
{
    Gtk::Main kit( argc, argv );
    Gtk::Window window;
    Gtk::Main::run( window );
    return 0;
}

---------------------snip-----------------

Here's the makefile:

---------------------snip-----------------
APP_NAME = tester
LIBS = `pkg-config --libs gtkmm-2.0`
CFLAGS = `pkg-config --cflags gtkmm-2.0`

$(APP_NAME): main.o
        g++ -o $(APP_NAME) main.o $(LIBS)

main.o: main.cpp
        g++ $(CFLAGS) main.cpp

clean:
        rm *.o $(APP_NAME)

---------------------snip-----------------

I get the following errors:

---------------------snip-----------------
[john quartz ~/dev/cpp/gtkmm/tester]$ make
g++ `pkg-config --cflags gtkmm-2.0` main.cpp
/tmp/cc3nHtxn.o(.text+0x20): In function `main':
: undefined reference to `Gtk::Main::Main[in-charge](int&, char**&, bool)'
/tmp/cc3nHtxn.o(.text+0x31): In function `main':
: undefined reference to `Gtk::Window::Window[in-charge](Gtk::WindowType)'
/tmp/cc3nHtxn.o(.text+0x40): In function `main':
: undefined reference to `Gtk::Main::run(Gtk::Window&)'
/tmp/cc3nHtxn.o(.text+0x4f): In function `main':
: undefined reference to `Gtk::Window::~Window [in-charge]()'
/tmp/cc3nHtxn.o(.text+0x5e): In function `main':
: undefined reference to `Gtk::Main::~Main [in-charge]()'
/tmp/cc3nHtxn.o(.text+0x75): In function `main':
: undefined reference to `Gtk::Window::~Window [in-charge]()'
/tmp/cc3nHtxn.o(.text+0x8f): In function `main':
: undefined reference to `Gtk::Main::~Main [in-charge]()'
collect2: ld returned 1 exit status
make: *** [main.o] Error 1

---------------------snip-----------------

Can anyone please give me a hint as to what I'm doing wrong?

Thanks,
---j




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]