13)
std::vector<InternalObj<T>* >::iterator iter = used_obj_.begin();
错误:expected ‘;’ before ‘iter’
std::vector<int> testv;
std::vector<int>::iterator iter1 = testv.begin();
以上两句语法正确。
C++规定,引用嵌套模版类的内部类型(如std::vector<T>::iterator),必须显示告诉编译器这是个type而不是variable。
例如
typename std::vector<InternalObj<T>* >::iterator iter = used_obj_.begin();
在VC或Intel Compiler中不会出现这样的问题。
但GCC编译器则会严格按照C++规定认为是个变量。
http://www.linuxidc.com/Linux/2013-01/77513.htm
14)
boost::timer
elapsed函数windows返回正确,linux下返回0
15)
‘memset’在此作用域中尚未声明
‘strlen’在此作用域中尚未声明
‘memcpy’在此作用域中尚未声明
#include <string.h>
16)
‘free’在此作用域中尚未声明
‘malloc’在此作用域中尚未声明
#include <stdlib.h>
17)‘_vsnprintf’在此作用域中尚未声明
#include <stdarg.h>
将_vsnprintf改成vsnprintf
18)‘_snprintf’在此作用域中尚未声明
#include <stdarg.h>
将_snprintf改成snprintf
19)‘_access’在此作用域中尚未声明
#include <unistd.h>
将_access改成access
20)
typedef ACE_Hash_Map_Manager< CQQ_USERSERIAL, SUSErAppDACItem*,ACE_Thread_Mutex> MAP_USER_APP_DAC;
ACE_Thread_Mutex在windows中和ACE_SYNCH_RECURSIVE_MUTEX效果相同,都为递归锁。
但在linux下
ACE_Thread_Mutex为非递归锁,同一个线程第二次进入则会死锁
21)
char p;
windwos下为:
typeid(p).name() 等于 "char"
linux下为:
typeid(p).name() 等于 "c"
unsigned long p
windwos下为:
typeid(p).name() 等于 "unsigned long"
linux下为:
typeid(p).name() 等于 "m"
unsigned short p
windwos下为:
typeid(p).name() 等于 "unsigned short"
linux下为:
typeid(p).name() 等于 "t"
