2011-03-23 65 views
4
_gnu_cxx::snprintf has not been declared 

當我包括我的CPP字符串。這個錯誤是在這一行:錯誤時<string>包括

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, 

回答

3

我在我的頭加入的#define _GLIBCXX_USE_C99_DYNAMIC 1解決了這個。