Re: [gtkmm] help getting "hello world" to build



On Sat, 2003-05-17 at 21:12, John M. Gabriele wrote:
> 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
                        ^ you should probably have '-c' here, otherwise
you're linking a binary

> 
> 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
                           ^  add '--ldflags' here, you need the libs

-- 
Regards,
Carl




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