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

错误: " '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", 即可.

C++ - 错误: " 'strdup' was not declared in this scope "_第1张图片




你可能感兴趣的:(C++,this,in,WAS,scope,not,not,declared,strdup,Mystra)