有 我是Gtk编程的新手,我在Windows上用VS2010编写了一个演示程序并在Windows 7 x64上顺利运行 但是在尝试在linux上运行它时遇到了一个问题,我不能简单地给出一个desc,所以我在这里粘贴错误:
lucid@lucid-desktop:~/Desktop/Debug$ mono NetLockAlert.EmbeddedUI.exe
mono: ../../src/xcb_io.c:249: process_responses: Assertion `(((long) (dpy- >last_request_read) - (long) (dpy->request)) <= 0)' failed.
Stacktrace:
at (wrapper managed-to-native) Gtk.Application.gtk_main () <0xffffffff>
at Gtk.Application.Run () <0x0000b>
at LionvilleSystems.NetLockAlert.EmbeddedUI.MainClass.Main (string[]) <0x00047>
at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <0xffffffff>
Native stacktrace:
mono() [0x80e0124]
[0x9e1410]
/lib/tls/i686/cmov/libc.so.6(abort+0x182) [0x13da82]
/lib/tls/i686/cmov/libc.so.6(__assert_fail+0xf8) [0x133718]
/usr/lib/libX11.so.6(+0x41a8d) [0x305a8d]
/usr/lib/libX11.so.6(_XEventsQueued+0x56) [0x306356]
/usr/lib/libX11.so.6(XPending+0x68) [0x2eea68]
/usr/lib/libgdk-x11-2.0.so.0(+0x53909) [0xb3e909]
/lib/libglib-2.0.so.0(g_main_context_check+0x2c9) [0xda7799]
/lib/libglib-2.0.so.0(+0x3f0ce) [0xda80ce]
/lib/libglib-2.0.so.0(g_main_loop_run+0x187) [0xda8817]
/usr/lib/libgtk-x11-2.0.so.0(gtk_main+0xb9) [0x110e3d9]
[0xa375b0]
[0xa37574]
[0x28bd30]
[0x28bddf]
mono() [0x8062cf8]
mono(mono_runtime_invoke+0x40) [0x8144ad0]
mono(mono_runtime_exec_main+0xd6) [0x81487b6]
mono(mono_main+0x1845) [0x80bb445]
mono() [0x805944a]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6) [0x126bd6]
mono() [0x8059291]
Debug info from gdb:
mono: ../../src/xcb_io.c:249: process_responses: Assertion `(((long) (dpy- >last_request_read) - (long) (dpy->request)) <= 0)' failed.
Aborted
lucid@lucid-desktop:~/Desktop/Debug$ ptrace: No such process.
--------------------------错误-------------------- ---------------------------------
答案 0 :(得分:0)
很难从这个错误中辨别出来:它是否一致?是每次启动时还是以后都会发生?
最可能的原因是您从多个线程调用GUI:这是不允许的。如果您不在主循环线程中,则应使用类似Gtk.Application.Invoke()的内容,此页面中提供了示例:http://www.mono-project.com/Responsive_Applications。