C++0x コードがいくつかあります。以下で再現できました。以下のコードは問題なく動作-std=c++0x
しますが、実際のコードには必要です。
C++0x に strdup を含めるにはどうすればよいですか? gcc 4.5.2 で
私はmingwを使用していることに注意してください。私はcstdlib、cstring、string.hを含めてみて、std::を使ってみました。運がない。
>g++ -std=c++0x a.cpp
a.cpp: In function 'int main()':
a.cpp:4:11: error: 'strdup' was not declared in this scope
コード:
#include <string.h>
int main()
{
strdup("");
return 0;
}