摘要: rt, 仅作记录,备忘 阅读全文
posted @ 2013-10-31 13:07 LittleAnt 阅读(339) 评论(0) 推荐(0) 编辑
摘要: 转自:http://www.cnblogs.com/OCaml/archive/2012/06/18/2554086.html#sec-1-1折腾gcc/g++链接时.o文件及库的顺序问题Table of Contents1 gcc/g++链接时.o文件以及库的顺序问题1.1 写在前面1.2 几个名... 阅读全文
posted @ 2013-10-31 11:53 LittleAnt 阅读(26869) 评论(0) 推荐(2) 编辑
摘要: 在程序中用到某个静态库,使用命令:gcc bin -llibrary.a object.o 结果发现找不到library.a中的某些函数符号undefine reference to ...通过nm命令查看library.a,发现该函数符号是存在的,说明library.a本身是没有问题的,百思不得其... 阅读全文
posted @ 2013-10-31 11:25 LittleAnt 阅读(4095) 评论(0) 推荐(0) 编辑
摘要: 转自 http://www.cnblogs.com/ylan2009/articles/2321177.htmlNote:1, Linux Shell 按Tab键不能补全发现使用新增的用户登陆的时候,在Shell里面不能使用Tab键补全命令,按上下键也不能切换历史命令,出现乱码的现象,后面发现,在/etc/passwd里面,新增的用户用的Shell与root用户的不一样。Root用的是/bin/bash,新增用户默认用的是/bin/sh,用ls -l /bin/sh发现/bin/sh -> /bin/dashdash与bash是不一样的,把/bin/sh改成/bin/bash后,问题解决 阅读全文
posted @ 2013-10-28 11:22 LittleAnt 阅读(513) 评论(0) 推荐(0) 编辑
摘要: 看代码的时候看到 typedef char xxx[sizeof(T) ? 1 : -1]; 这种语句如:JavaScriptCore/wtf/OwnPtrCommon.htemplate inline void deleteOwnedPtr(T* ptr){ typedef char known[sizeof(T) ? 1 : -1]; if (sizeof(known)) delete ptr;}以前没碰到过这样的代码,查了一下,发现这么做是为了避免 delete void *什么是delete void * 问题?如果某堆对象的指针被转成void *,那么delete... 阅读全文
posted @ 2013-09-27 18:01 LittleAnt 阅读(472) 评论(0) 推荐(0) 编辑
摘要: 转自http://blog.csdn.net/ithomer/article/details/65667391. __attribute__GNU C的一大特色(却不被初学者所知)就是__attribute__机制。__attribute__可以设置函数属性(Function Attribute)、变量属性(Variable Attribute)和类型属性(Type Attribute)__attribute__前后都有两个下划线,并且后面会紧跟一对原括弧,括弧里面是相应的__attribute__参数__attribute__语法格式为:__attribute__ ( ( attribute 阅读全文
posted @ 2013-09-25 15:42 LittleAnt 阅读(290) 评论(0) 推荐(0) 编辑
摘要: 摘自:http://blog.chinaunix.net/uid-15014334-id-3429627.html在UNIX/LINUX下,1,对于主动关闭的SOCKET, recv返回-1,而且errno被置为9(#define EBADF 9 /* Bad file number */)或104 (#define ECONNRESET 104 /* Connection reset by peer */)2,对于被动关闭的SOCKET,recv返回0,而且errno被置为11(#define EWOULDBLOCK EAGAIN /* Operation would block */)3, 阅读全文
posted @ 2013-09-11 17:41 LittleAnt 阅读(3755) 评论(0) 推荐(0) 编辑
摘要: 最近在使用std::thread的时候,遇到这样一个问题:std::thread t(func);如果不使用调用t.join()就会遇到 "terminate called whithout an active exception",但是在使用boost:thread的时候却没遇到这个问题,google了一下,找到答案:The trouble you are encountering is a result of thestopThreadgoing out of scope on the stack. The C++ standard has the following 阅读全文
posted @ 2013-09-10 18:24 LittleAnt 阅读(15313) 评论(0) 推荐(0) 编辑
摘要: http://www.cnblogs.com/gaozehua/archive/2011/09/02/2164077.html 阅读全文
posted @ 2013-09-06 17:27 LittleAnt 阅读(148) 评论(0) 推荐(0) 编辑
摘要: C++11 onAndroidThe latest AndoirdNDK r8efinally supports some of the most important C++11 library features: thread, mutex, atomic andsoon. It is now straightforward to write multi-threaded programs using C++11 on Android, without hacking and jumping through hoops. Allyouneed is downloading NDK r8e.T 阅读全文
posted @ 2013-09-06 17:26 LittleAnt 阅读(1729) 评论(0) 推荐(0) 编辑