运行galde编写的UI程序时报错:libglade-WARNING **: could not find signal handler 'gtk_reset'.

解决方案1:

  在GCC编译命令中加入-export-dynamic,如:  

gcc test.c callbacks.c -o test `pkg-config --libs --cflags libglade-2.0 ` -export-dynamic

  

解决方案2:

  在GCC编译命令中使用pkg-config加入库gmodule-export-2.0,如:

gcc test.c callbacks.c -o test `pkg-config --libs --cflags libglade-2.0 gmodule-export-2.0`

  

问题原因,以下是libglade说明里的一段原话。

Note
If you wish to autoconnect handlers defined in the main executable (not a shared library), you will need to pass a linker flag to 
export the executable's symbols for dynamic linking. This flag is platform specific, but libtool can take care of this for you. 
Just add -export-dynamic argument to your link flags, and libtool will convert it to the correct format.
The easiest way to get the correct extra flags is to check for gmodule-export-2.0 with pkg-config.

 

疑问:为什么?

need to pass a linker flag to export the executable's symbols for dynamic linking


一种回答:

Libglade can also automatically connect signal handlers in the user interface. It does this by matching handler names specified in the glade file with symbols in the executable looked up with the gmodule library (this requires that applications be linked with the --export-dynamic flag).

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值