C++ - 错误: " 'strdup' was not declared in this scope "

2014-11-24 12:01:25 · 作者: · 浏览: 0

错误: " 'strdup' was not declared in this scope "


本文地址: http://blog.csdn.net/caroline_wendy/article/details/24041455


函数名: strdup; 功能: 将串拷贝到新建的位置处; 用法: char *strdup(char *str);


strdup属于GNU C++的函数, 不是标准(std)C++的函数, 需要修改参数:

把"-std=c++11"修改为"-std=gnu++0x", 即可.

\