problem about cross compiling win32 program under linux





I tend to compile win32 gtk program under linux using mingw like this:

i486-mingw32-gcc  `pkg-config --libs --cflags gtk+-2.0` -Isoftware/win_gtk_dev/zlib-dev_1.2.4-2_win32/include -Lsoftware/win_gtk_dev/zlib-dev_1.2.4-2_win32/lib -lz -Isoftware/win_gtk_dev/gettext-runtime-dev-0.17-1/include -Lsoftware/win_gtk_dev/gettext-runtime-dev-0.17-1/lib hello.c -o hello.exe

and the pkg-config result is:

-mms-bitfields -Isoftware/win_gtk_dev/glib-dev_2.24.0-2_win32/include/glib-2.0 -Isoftware/win_gtk_dev/glib-dev_2.24.0-2_win32/lib/glib-2.0/include -Isoftware/win_gtk_dev/gtk+-dev_2.20.0-1_win32/include/gtk-2.0 -Isoftware/win_gtk_dev/gtk+-dev_2.20.0-1_win32/lib/gtk-2.0/include -Isoftware/win_gtk_dev/atk-dev_1.30.0-1_win32/include/atk-1.0 -Isoftware/win_gtk_dev/pango-dev_1.28.0-1_win32/include/pango-1.0 -Isoftware/win_gtk_dev/cairo-dev_1.8.10-3_win32/include/cairo -Isoftware/win_gtk_dev/freetype-dev_2.3.12-1_win32/include/freetype2 -Isoftware/win_gtk_dev/freetype-dev_2.3.12-1_win32/include -Isoftware/win_gtk_dev/libpng-dev_1.4.0-1_win32/include/libpng14 -Isoftware/win_gtk_dev/fontconfig-dev_2.8.0-2_win32/include  -Lsoftware/win_gtk_dev/glib-dev_2.24.0-2_win32/lib -Lsoftware/win_gtk_dev/gtk+-dev_2.20.0-1_win32/lib -Lsoftware/win_gtk_dev/atk-dev_1.30.0-1_win32/lib -Lsoftware/win_gtk_dev/pango-dev_1.28.0-1_win32/lib -Lsoftware/win_gtk_dev/cairo-dev_1.8.10-3_win32/lib -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl

but the gcc got errors like this:

/tmp/ccVjxeyH.o:hello.c:(.text+0xe): undefined reference to `_g_print'
/tmp/ccVjxeyH.o:hello.c:(.text+0x22): undefined reference to `_g_print'
/tmp/ccVjxeyH.o:hello.c:(.text+0x34): undefined reference to `_gtk_main_quit'
/tmp/ccVjxeyH.o:hello.c:(.text+0x6e): undefined reference to `_gtk_init_abi_check'
/tmp/ccVjxeyH.o:hello.c:(.text+0x7a): undefined reference to `_gtk_window_new'
/tmp/ccVjxeyH.o:hello.c:(.text+0xb3): undefined reference to `_g_signal_connect_data'
/tmp/ccVjxeyH.o:hello.c:(.text+0xe8): undefined reference to `_g_signal_connect_data'
/tmp/ccVjxeyH.o:hello.c:(.text+0xed): undefined reference to `_gtk_container_get_type'
/tmp/ccVjxeyH.o:hello.c:(.text+0xfd): undefined reference to `_g_type_check_instance_cast'
/tmp/ccVjxeyH.o:hello.c:(.text+0x10d): undefined reference to `_gtk_container_set_border_width'
/tmp/ccVjxeyH.o:hello.c:(.text+0x119): undefined reference to `_gtk_button_new_with_label'
/tmp/ccVjxeyH.o:hello.c:(.text+0x152): undefined reference to `_g_signal_connect_data'
/tmp/ccVjxeyH.o:hello.c:(.text+0x157): undefined reference to `_gtk_widget_destroy'
/tmp/ccVjxeyH.o:hello.c:(.text+0x187): undefined reference to `_g_signal_connect_data'
/tmp/ccVjxeyH.o:hello.c:(.text+0x18c): undefined reference to `_gtk_container_get_type'
/tmp/ccVjxeyH.o:hello.c:(.text+0x19c): undefined reference to `_g_type_check_instance_cast'
/tmp/ccVjxeyH.o:hello.c:(.text+0x1ac): undefined reference to `_gtk_container_add'
/tmp/ccVjxeyH.o:hello.c:(.text+0x1b8): undefined reference to `_gtk_widget_show'
/tmp/ccVjxeyH.o:hello.c:(.text+0x1c4): undefined reference to `_gtk_widget_show'
/tmp/ccVjxeyH.o:hello.c:(.text+0x1c9): undefined reference to `_gtk_main'

anyone know what's the matter? thank you :)


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