LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 700|回复: 2

libsigc版本1.2与2.0的区别,不知道对不对?

[复制链接]
发表于 2004-12-24 14:24:08 | 显示全部楼层 |阅读模式
libsigc1.2 =》 libsigc2.0
SigC::slot() =》 sigc::mem_fun()
SigC::bind() =》 sigc::bind()

因为我编译gtkmm中文档说的例子的时候装了libsigc2.0,每次都报错误,我把上面的SigC::slot() 改为sigc::mem_fun()就可以了,
我怀疑是这个原因,不知道对不对。
发表于 2004-12-27 09:27:12 | 显示全部楼层
有同样的经历,不过我的还要惨一些,在编译gtkmm文档上面的例子的时候,第三章以前的例子还能正确通过。第四章的例子,在遇到sigc::slot的时候一律以sigc命名空间中未定义来报错,好象我的改成sigc::mem_fun()也不行。真是FT。
    哪位大虾知道该怎么处理才能正确编译,官方的文档都有错误确实有点儿说不过去。  :confused:

Post by shansheng
libsigc1.2 =》 libsigc2.0
SigC::slot() =》 sigc::mem_fun()
SigC::bind() =》 sigc::bind()

因为我编译gtkmm中文档说的例子的时候装了libsigc2.0,每次都报错误,我把上面的SigC::slot() 改为sigc::mem_fun()就可以了,
我怀疑是这个原因,不知道对不对。
发表于 2004-12-27 09:44:34 | 显示全部楼层
> gtkmm-list mailing list
> gtkmm-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list

That is for libsigc++ 1.x.  In 2.x, the namespace is sigc (all
lowercase), and there isn't a public slot function that I know of - for
the example you will need to use sigc::mem_fun().  I also had to figure
this out as I was reading through the tutorial book.  Check which
libsigc++ you are using - if you are using Gtkmm 2.4 then you have to be
using libsigc++ 2.x.

HTH,
Matt

以上是我在gtkmm的官方mailing list上面问问题的时候,别人的回答,我按着回答试了一下,发现果然是这样子。就是:
在libsigc++2.0上面名字空间是sigc(全部是小写)。而且第四章的例子中slot不是public的,用mem_fun()才行。各位大虾试试看呢?可能这样就会正确的。
刚开始在windows学习gtkmm编程的VC编程员们,要注意哦!
祝大家
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表