mingw-cross-env-list
[Top][All Lists]
Advanced

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

Re: [Mingw-cross-env-list] Error building mxe/src/gtk2-test.c


From: Alex Zelid
Subject: Re: [Mingw-cross-env-list] Error building mxe/src/gtk2-test.c
Date: Tue, 9 Dec 2014 12:17:46 +0200

Well, my bad. Thanks to recent Tony's email and checking i686-w64-mingw32.static-pkg-config --list-all I figured out the right name for GTK and everything compiled well using:

i686-w64-mingw32.static-gcc -I/home/alex/opt/mxe/usr/i686-w64-mingw32.static/include/atk-1.0 -o example-0.exe example-0.c `i686-w64-mingw32.static-pkg-config --libs --cflags gtk+-win32-2.0`



On Tue, Dec 9, 2014 at 12:13 PM, Alex Zelid <address@hidden> wrote:
Hello,

I found that MXE includes GTK2 and some sample mxe/src/gtk2-test.c

After checking mxe/usr/i686-w64-mingw32.static/lib/pkgconfig I found that it has gdk-2.0.pc (sounds like gtk-2.0) why the name is gdk and not gtk?

I tried to build it gtk2-test.c:

i686-w64-mingw32.static-gcc -o example-0.exe example-0.c `i686-w64-mingw32.static-pkg-config --libs --cflags gdk-2.0`

and:

i686-w64-mingw32.static-gcc -o example-0.exe example-0.c `i686-w64-mingw32.static-pkg-config --libs --cflags gdk-win32-2.0`

In both cases I got an error:

In file included from /home/alex/opt/mxe/usr/i686-w64-mingw32.static/include/gtk-2.0/gtk/gtkcontainer.h:35:0,
                 from /home/alex/opt/mxe/usr/i686-w64-mingw32.static/include/gtk-2.0/gtk/gtkbin.h:35,
                 from /home/alex/opt/mxe/usr/i686-w64-mingw32.static/include/gtk-2.0/gtk/gtkwindow.h:36,
                 from /home/alex/opt/mxe/usr/i686-w64-mingw32.static/include/gtk-2.0/gtk/gtkdialog.h:35,
                 from /home/alex/opt/mxe/usr/i686-w64-mingw32.static/include/gtk-2.0/gtk/gtkaboutdialog.h:32,
                 from /home/alex/opt/mxe/usr/i686-w64-mingw32.static/include/gtk-2.0/gtk/gtk.h:33,
                 from example-0.c:6:
/home/alex/opt/mxe/usr/i686-w64-mingw32.static/include/gtk-2.0/gtk/gtkwidget.h:40:21: fatal error: atk/atk.h: No such file or directory
 #include <atk/atk.h>
                     ^
compilation terminated.

Then I figured out that atk is in it's own subdirectory mxe/usr/i686-w64-mingw32.static/include/atk-1.0/atk

So I added additional include and compiled using:

i686-w64-mingw32.static-gcc -I/home/alex/opt/mxe/usr/i686-w64-mingw32.static/include/atk-1.0 -o example-0.exe example-0.c `i686-w64-mingw32.static-pkg-config --libs --cflags gdk-2.0`

That gives a new error:

/tmp/ccLrOTA7.o:example-0.c:(.text+0x35): undefined reference to `gtk_init_abi_check'
/tmp/ccLrOTA7.o:example-0.c:(.text+0x41): undefined reference to `gtk_window_new'
/tmp/ccLrOTA7.o:example-0.c:(.text+0x51): undefined reference to `gtk_button_new_with_label'
/tmp/ccLrOTA7.o:example-0.c:(.text+0x5a): undefined reference to `gtk_container_get_type'
/tmp/ccLrOTA7.o:example-0.c:(.text+0x7c): undefined reference to `gtk_container_add'
/tmp/ccLrOTA7.o:example-0.c:(.text+0xc2): undefined reference to `gtk_widget_destroy'
/tmp/ccLrOTA7.o:example-0.c:(.text+0x106): undefined reference to `gtk_main_quit'
/tmp/ccLrOTA7.o:example-0.c:(.text+0x122): undefined reference to `gtk_widget_show'
/tmp/ccLrOTA7.o:example-0.c:(.text+0x12e): undefined reference to `gtk_widget_show'
/tmp/ccLrOTA7.o:example-0.c:(.text+0x133): undefined reference to `gtk_main'
collect2: error: ld returned 1 exit status

That I don't know how to handle.

Why we have name GDK instead of GTK and how to compile those simple GTK-2.0 sample?

Thank you,
Alex










reply via email to

[Prev in Thread] Current Thread [Next in Thread]