0

我正在开发一个应用程序(包含 3 个项目,2 个在 c++ 中,一个在 Objective-C 中),它可以完美地为 LLVM GCC 编译器编译。但是当我将编译器切换到“Apple LLVM compiler 3.0”时,我发现了一个奇怪的错误,如下所示:

error: implicit instantiation of undefined template 'EList<ETemplateString<char>>'

以上错误显示在以下代码行中:

   EList<EString> outlist;

前向声明的 EList 如下:

template <class T> class EList; // forward decls

EString 声明如下:

typedef ETemplateString<TCHAR>         EString;

其余使用的模板定义为:

template <class T> class ETemplateString
{
//
//
//
}

并且 TCHAR 被声明为:

typedef char TCHAR;

谁能告诉我为什么它用 GCC 编译得很好,并在“Apple LLVM 编译器 3.0”中抛出错误

4

1 回答 1

1

请参阅http://clang.llvm.org/compatibility.html#undep_incomplete

于 2011-11-21T20:06:53.957 回答