libsigc++-1.2.5库的使用
来源:互联网 发布:p6软件 编辑:程序博客网 时间:2024/06/08 11:11
libsigc++-1.2.5库的使用
下载地址
解压文件
./configure --prefix=/usr
make;make insatll
examples中的简单列子
#include <iostream>#include <string>#include <sigc++/sigc++.h>using namespace std;using namespace SigC;void print(const string &str){cout << str;}main(){Signal1<void,const string &> printer; //定义一个参数为const string&,返回值为void的信号printer.connect(slot(print)); //连接信号和槽printer("hello world\n"); //发送信号,等同于直接调用print函数}g++ hello.cpp -o hello `pkg-config --cflags --libs sigc++-1.2`
运行结果:hello world
信号的类型SigC::Signal1的模板参数中第一个是返回值类型,后面是信号参数的类型,sigc++.h中提供了Signal0~Signal5,对应函数的参数个数。
0 0
- libsigc++-1.2.5库的使用
- libsigc++库的使用
- 介绍一个类型安全的回调库:libsigc++
- Boost.Signals vs libsigc++
- STLport, libsigc++ and DDK
- libevent库的使用--定时器的使用
- UEditor 1.2.5 for jsp的使用
- tinyxml库的使用
- tinyxml库的使用
- NCURSES库的使用
- iconv库的使用
- sigslot库的使用
- jrtplib库的使用
- 静态库的使用
- 静态库的使用
- adns库的使用
- curl 库的使用
- tinyxml库的使用
- 剪图神器官网
- DAL(4)
- Oracle数据库备份与恢复特性浅谈
- 交叉编译jrtplib3.9.1详解
- Push or Pull
- libsigc++-1.2.5库的使用
- Localhost ,127.0.0.1 和 计算机 IP地址
- nutch安装与测试
- iOS 多线程 锁 互斥 同步
- SQL SERVER分区表探寻(二)
- 画刷和歌词播放效果+变换和投射
- 关于"failed to report status for 600 seconds. killing"的错误
- dedecms 按照ID升序 降序排列方法
- jQuery Autocomplete 使用详细说明(二)