Windows gtk programming



I've been using glade/gtk et al for a few years now under Linux, and only now 
have a requirement to do some programming under windows (urk).

I've installed current copies of msys, mingw, and gtk from the installers on 
the 'net ..... so far so good. But when I try to test a simples, stupid gtk 
programme, it fails at the link - like it's not finding or searching the 
libraries properly. 

I'm sure I'm missing something small, simple & stupid - but I'll be buggered 
if I can figure out what it is.

Here's the details:

Makefile:

CFLAGS    += -pipe -O2 `pkg-config --cflags gtk+-win32-2.0`
LDFLAGS    += `pkg-config --libs gtk+-win32-2.0`

test:    test.c
    $(CC) -c $(CFLAGS) test.c -o test.o
    $(CC) $(LDFLAGS) test.o -o test

Output from pkg-config:

pkg-config --cflags gtk+-win32-2.0
-mms-bitfields -I/d/GTK/include/gtk-2.0 -I/d/GTK/lib/gtk-2.0/include 
-I/d/GTK/include/atk-1.0 -I/d/GTK/include/cairo 
-I/d/GTK/include/pango-1.0 -I/home/ivan/cross/build/include/cairo 
-I/d/GTK/include/glib-2.0 -I/d/GTK/lib/glib-2.0/include 

pkg-config --libs  gtk+-win32-2.0
-L/d/GTK/lib -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgdk_pixbuf-2.0 
-lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0 -lcairo 
-lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv 


The source for the C programme itself:

#include <gtk/gtk.h>

int main(argc, argv)
    int                 argc;
    char                *argv[];
{
   GtkWidget           *widget;
   
    gtk_init(&argc, &argv);
    gtk_main();
    exit(0);
}


and finally, the output of the make in question:

make
gcc -c -pipe -O2 `pkg-config --cflags gtk+-win32-2.0` test.c -o test.o
gcc `pkg-config --libs gtk+-win32-2.0` test.o -o test
test.o(.text+0x41):test.c: undefined reference to `gtk_init_abi_check'
test.o(.text+0x46):test.c: undefined reference to `gtk_main'
collect2: ld returned 1 exit status
make: *** [test] Error 1


HELLLLLLLLLLLP!



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