【发布时间】:2019-08-29 23:10:56
【问题描述】:
我无法弄清楚为什么以下代码(ICU 示例)无法编译:
void test()
{
icu::Locale locale = icu::Locale("en");
UErrorCode status = U_ZERO_ERROR;
DateTimePatternGenerator* generator =
DateTimePatternGenerator::createInstance(locale, status);
UnicodeString pattern =
generator->getBestPattern(UnicodeString("MMMd"), status);
SimpleDateFormat* formatter =
new SimpleDateFormat(pattern, locale, status);
}
错误是:error C2027: use of undefined type 'icu_62::SimpleDateFormat'
IDE 给出消息:“前向声明,不允许不完整的类型”。
任何建议将不胜感激。
【问题讨论】: