On 06/11/2018 14:49, KC wrote:
>
> Hi,
>
> KC <address@hidden <mailto:address@hidden>> 於 2018年11月6日 週二
> 下午10:01寫道:
>
> Hi,
>
> I had MXE build successfully on CentOS 7 which I used for a long time
> without any problem with Gtk2.
>
> Recently, I try Gtk3 use the following commands:
>
> x86_64-w64-mingw32.static-gcc -mms-bitfields hello.c \
> `x86_64-w64-mingw32.static-pkg-config --cflags --libs
> gtk+-3.0` -o hello.exe
>
> or
> i686-w64-mingw32.static-gcc -mms-bitfields hello.c \
> `i686-w64-mingw32.static-pkg-config --cflags --libs
> gtk+-3.0` -o hello.exe
>
> where hello.c is a simple app. which has only one button (It run
> well when compile with Gtk2).
> The hello.exe can run by WINE. But when I copy it to 64bits Win7,
> it crash !!!
> Anyone has similar problem ?
>
>
> NOTE: it can't run on WinXP neither, but I believe that's because
> Gtk3 no longer support WinXP.
>
> The following is hello.c:
>
> #if defined(_WIN32) || defined(_WIN64) || defined(_MSC_VER)
> # include <windows.h>
> #else
> # include <unistd.h>
> #endif
>
> #include <gtk/gtk.h>
>
> int
> main(int argc, char *argv[])
> {
> GtkWidget *win, *button;
>
> gtk_init(&argc, &argv);
> win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
> button = gtk_button_new_with_label("Hello");
>
> gtk_container_add(GTK_CONTAINER(win), button);
>
> gtk_widget_show_all(win);
> gtk_main();
>
> exit(0);
> }
>
> I decide to use gdb.exe to take a look ....
>
> d:\tmp>gdb.exe hello.exe
> GNU gdb (GDB) 7.12.1
> ...
> (gdb) run
> Starting program: d:\tmp\hello.exe
> [New Thread 6044.0x10e8]
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x00765671 in gdk_win32_display_get_monitor (display=0x52b8008,
> monitor_num=0)
> at
> /opt/mxe.build/mxe.static.20180830/tmp-gtk3-i686-w64-mingw32.static/gtk+-3.22.7/gdk/win32/gdkdisplay-win32.c:1112
> 1112
> /opt/mxe.build/mxe.static.20180830/tmp-gtk3-i686-w64-mingw32.static/gtk+-3.22.7/gdk/win32/gdkdisplay-win32.c:
> No such file or directory.
> ...
>
>
>
> The problem comes from gdk_win32_display_get_monitor() !!
> That give me some cues ...
> I realize that I run the hello.exe on Win7 via rdesktop.exe !! So, I go
> to the
> physical monitor and run the hello.exe again ... and it works !!!
>
>
> Best Regards,
> KC
I'm not a maintainer, just a user, but I'm pretty sure i686 is for 32
bit windows, x86_64 is for 64 bit programs. What hap[ens when you build
using the x86_64-w64-mingw32.static-gcc option?
Both i686 and x86_64 version have the same issue.
But I believe it's DISPLAY related problem.
KC
Richard