C++学习
shrekmu
企者不立;跨者不行;自见者不明;自是者不彰;自伐者无功;自矜者不长。
展开
-
使用C++操作OpenLDAP
一、API选择 当使用C++操作OpenLDAP时,在编译的过程中会关闭 LDAP_DEPRECATED 开关,导致所有deprecated的API都不能够使用,报错:ldap_util.c:19: error: `ldap_init undeclared (first use this function)ldap_util.c:19: error: (Each undeclared id原创 2006-09-26 18:09:00 · 2979 阅读 · 0 评论 -
Linux下CppUnit的安装与使用
一、系统环境: Red Hat Enterprise Linux4.0 Kernel:2.6.9-5 EL 二、Red Hat Enterprise Linux4.0下CppUnit1.12.0的安装取得:http://sourceforge.net/projects/cppunit/ 最新的稳定版本为1.12.0。下载:cppunit-1.12.0.tar.gz。解压缩: tar原创 2006-10-19 18:07:00 · 1617 阅读 · 0 评论 -
关于OpenLDAP查询以后的内存释放
示例代码: // データベースにエントリーを検索する result = ldap_search_ext_s(ld, base.c_str(), LDAP_SCOPE_SUBTREE, str_filter.c_str(), attrs, 0, NULL, NULL, TIME_OUT, sizeLimite, &msg);原创 2006-11-14 10:32:00 · 1197 阅读 · 0 评论 -
连接OpenLDAP时,设定Network Time out时间的方法
// 设定time out时间 struct timeval network_timeout; network_timeout.tv_usec = 0; network_timeout.tv_sec = 10; // 设定time out时间 result = ldap_set_option(*ld, LDAP_OPT_NETWORK_TIMEOUT, &network原创 2006-11-24 13:21:00 · 1241 阅读 · 0 评论 -
C++下最简单的log打印函数
#include using namespace std; #ifndef DEBUG#define LOG(log)#else#define LOG(log) cout #endif int main(){ int ia[3] = {1, 2, 3}; for (int i = 0; i { LOG(ia[i]); }}编译时使用gcc -O tes原创 2007-02-12 17:25:00 · 3010 阅读 · 0 评论