_gnu_cxx::snprintf has not been declared
当我在我的 cpp 中包含字符串时。此错误位于此行:
using ::__gnu_cxx::snprintf;
cstdio 包含在这个顺序中:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/usr/include/c++/4.2.1/string:47,
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/usr/include/c++/4.2.1/bits/char_traits.h:46,
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:70,
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/usr/include/c++/4.2.1/iosfwd:45,
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/usr/include/c++/4.2.1/iosfwd:45,
最佳答案
我通过在标题中添加#define _GLIBCXX_USE_C99_DYNAMIC 1 解决了这个问题。
关于iphone - 包含 <string> 时 <cstdio> 出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5402663/