GTK+Glade3 Gtk-WARNING **: Could not find signal handler 问题最终解析
2013-03-19 18:36
1076 查看
GTK + 使用 Glade3 编程时,调用自动信号连接
gtk_builder_connect_signals();
编译时不出现任何问题,但是运行时提示
Gtk-WARNING **: Could not find signal handle
可能产生的原因:
Windows 平台:
1)callback 函数没加 G_MODULE_EXPORT
宏定义如下:
#ifdef G_PLATFORM_WIN32
# define G_MODULE_EXPORT __declspec(dllexport)
#else /* !G_PLATFORM_WIN32 */
# define G_MODULE_EXPORT
#endif /* !G_PLATFORM_WIN32 */
2)编译选项没加 -export-dynamic
Linux 平台:
1)忘加编译选项 -export-dynamic
2)如果使用 C++ 编译器,由于C++ 有名字粉碎(C++ symbol mangling), GTK+是C程序,需使用c风格的回调函数
函数声明前加上
extern “C” 或者使用
extern "C" { ......................}
3)当然 修改G_MODULE_EXPORT 的宏定义,在回调函数定义前加G_MODULE_EXPORT宏也可以
#ifdef G_PLATFORM_WIN32
# define G_MODULE_EXPORT __declspec(dllexport)
#else /* !G_PLATFORM_WIN32 */
# define G_MODULE_EXPORT extern "C"
#endif /* !G_PLATFORM_WIN32 */
gtk_builder_connect_signals();
编译时不出现任何问题,但是运行时提示
Gtk-WARNING **: Could not find signal handle
可能产生的原因:
Windows 平台:
1)callback 函数没加 G_MODULE_EXPORT
宏定义如下:
#ifdef G_PLATFORM_WIN32
# define G_MODULE_EXPORT __declspec(dllexport)
#else /* !G_PLATFORM_WIN32 */
# define G_MODULE_EXPORT
#endif /* !G_PLATFORM_WIN32 */
2)编译选项没加 -export-dynamic
Linux 平台:
1)忘加编译选项 -export-dynamic
2)如果使用 C++ 编译器,由于C++ 有名字粉碎(C++ symbol mangling), GTK+是C程序,需使用c风格的回调函数
函数声明前加上
extern “C” 或者使用
extern "C" { ......................}
3)当然 修改G_MODULE_EXPORT 的宏定义,在回调函数定义前加G_MODULE_EXPORT宏也可以
#ifdef G_PLATFORM_WIN32
# define G_MODULE_EXPORT __declspec(dllexport)
#else /* !G_PLATFORM_WIN32 */
# define G_MODULE_EXPORT extern "C"
#endif /* !G_PLATFORM_WIN32 */
相关文章推荐
- GTK+中使用Glade3编程遇到Gtk-WARNING **: Could not find signal handler的问题
- 运行galde编写的UI程序时报错:libglade-WARNING **: could not find signal handler 'gtk_reset'.
- gtkglade-WARNING **: could not find signal handler
- php【Warning: imageftbbox(): Could not find/open font in……】的问题
- RAC 中 ORA-12516: TNS: listener could not find available handler with matching protocol stack
- ibatis Could not find SQL statement to include with refid 'xxx' 问题
- 系统真机测试时出现 could not find developer disk image问题
- 解决 Gradle 2.0后 : Could not find property 'Compile' on root project 的问题
- Could not find make command: mingw32-make.exe in the build environment问题详细解答
- could not find implicit value for parameter extractor 问题的解决
- 1.storm问题总结 Could not find leader nimbus from seed hosts [localhost] Did you specify a valid list of
- Beaglebone 管脚配置出现:_omap_mux_get_by_name: Could not find signal gpmc_wpn.gpmc_csn5
- Could not find artifact com.sun:tools:jar:1.5.0 问题解决
- windows XP升级SP3导致的ping 域名显示 Ping request could not find host 但是nslookup能正常解析的解决办法
- Warning: Could not find an exact (case-sensitive) match for 'Title'.
- cxf客户端调用webservice,出现问题 Found element arg0 but could not find matching RPC/Literal part
- could not find the main class, Program will exit java编译器版本的问题
- "Could not find Developer Disk Image"问题,为Xcode 7.3之前版本配置iOS9.3配置包
- Could not find result map Java.util.Map 问题分析
- 解决Xcode 9.3系统真机测试时出现 could not find developer disk image问题