在gcc中加入-std=c++11.
编译错误1
error: ‘shared_ptr’ is not a member of ‘std’
std::shared_ptr<net_que_handle> q_handle = make_shared<net_que_handle>();
解决:gcc中加入-std=c++11,如cc -g -std=c++11 -o xxx
编译错误2
unable to find string literal operator ‘operator"" __FILE__’
#define PROXY_LOG(format,...) printf("FILE:"__FILE__",line:%05d:"format"/n",__LINE__,##__VA_ARGS__)
错误解决:c++11要求字符串和变量拼接的时候要加空格,改为
#define PROXY_LOG(format,...) printf("FILE:" __FILE__ ",line:%05d:" format "/n",__LINE__,##__VA_ARGS__)即可
编译错误1
error: ‘shared_ptr’ is not a member of ‘std’
std::shared_ptr<net_que_handle> q_handle = make_shared<net_que_handle>();
解决:gcc中加入-std=c++11,如cc -g -std=c++11 -o xxx
编译错误2
unable to find string literal operator ‘operator"" __FILE__’
#define PROXY_LOG(format,...) printf("FILE:"__FILE__",line:%05d:"format"/n",__LINE__,##__VA_ARGS__)
错误解决:c++11要求字符串和变量拼接的时候要加空格,改为
#define PROXY_LOG(format,...) printf("FILE:" __FILE__ ",line:%05d:" format "/n",__LINE__,##__VA_ARGS__)即可