C3203编译错误

简介:
在编译OgreMeshViewer的时候产生了C3203的错误:

meshviewer\exWTL\DotNetTabCtrl.h(1515) : error C3203: “CDotNetTabCtrl”: 未专用化的类 模板 不能用作 模板 变量,该变量属于 模板 参数“T”,应为 real 类型

其代码如下:
None.giftemplate < class TItem = CCustomTabItem>
None.gif class CDotNetTabCtrl :
None.gif     public CDotNetTabCtrlImpl<CDotNetTabCtrl, TItem>
ExpandedBlockStart.gif {
InBlock.gifprotected:
InBlock.gif    typedef CDotNetTabCtrl thisClass;
InBlock.gif    typedef CDotNetTabCtrlImpl<CDotNetTabCtrl, TItem> baseClass;
InBlock.gif
InBlock.gif// Constructors:
InBlock.gif
public:
InBlock.gif    CDotNetTabCtrl()
ExpandedSubBlockStart.gif    {
ExpandedSubBlockEnd.gif    }

InBlock.gif
InBlock.gifpublic:
InBlock.gif
InBlock.gif    DECLARE_WND_CLASS(_T("WTL_DotNetTabCtrl"))  
InBlock.gif
InBlock.gif    //We have nothing special to add.
InBlock.gif    
//BEGIN_MSG_MAP(thisClass)
InBlock.gif    
//    CHAIN_MSG_MAP(baseClass)
InBlock.gif    
//END_MSG_MAP()
ExpandedBlockEnd.gif
}
;


根据MSDN所述:
None.gif //  C3203.cpp
None.gif
template< typename T >
ExpandedBlockStart.gif struct X  {
ExpandedSubBlockStart.gif   void f(X) {}
ExpandedBlockEnd.gif}
;
None.gif
None.giftemplate< typename T >
ExpandedBlockStart.gif struct Y :  public X<Y>  {   // C3203
InBlock.gif
// try the following line instead
InBlock.gif
// struct Y : public X<Y<T> > {
ExpandedSubBlockStart.gif
   void f(Y) {}
ExpandedBlockEnd.gif}
;
None.gif
ExpandedBlockStart.gif int main()  {
InBlock.gif   Y<int> y;
ExpandedBlockEnd.gif}

None.gif


将第三行代码替换成:
None.gif public CDotNetTabCtrlImpl<CDotNetTabCtrl<TItem>, TItem>

即可。
目录
相关文章
|
26天前
|
编译器 C++
C++:编译器对被const修饰变量的处理行为(替换)
C++:编译器对被const修饰变量的处理行为(替换)
13 0
|
11月前
|
C++
C2440编译错误:__cplusplus编译选项引发的
C2440编译错误:__cplusplus编译选项引发的
178 0
C2440编译错误:__cplusplus编译选项引发的
|
11月前
|
安全 编译器 C语言
VS编译器警告scanf未定义的三种解决办法
我们开始学习编程时候上手第一门语言通常是C语言,我们还需要下载一个编译器,最常见的莫过于Microsoft公司开发的Visual Studio(下面都简称VS)系列编译器,但是VS中我们使用scanf等函数时语句总是报错,显示不安全。
VS编译器警告scanf未定义的三种解决办法
|
11月前
|
编译器 程序员 C语言
C 语言标准及编译器介绍
今天给大家介绍一下C语言标准及其由来
246 0
|
C++
VS编译错误:error C2143: 语法错误 : 缺少“;”(在“类型”的前面)
VS编译错误:error C2143: 语法错误 : 缺少“;”(在“类型”的前面)
250 0
反编译报错 using 语句中使用的类型必须可隐式转换为“System.IDisposable“
反编译报错 using 语句中使用的类型必须可隐式转换为“System.IDisposable“
|
自然语言处理 编译器
【译】一个超级小的编译器
【译】一个超级小的编译器
65 0
编译出错 recompile with -fPIC
编译出错 recompile with -fPIC
101 0
|
C++ 编译器
C++ 编译器
C++编译器 当我们定义了一个类的时候, C++编译器在默认的情况下会为我们添加默认的构造方法, 拷贝构造方法, 析构函数和=运算符 在第一次创建对象的语句中如: MyString myString = "hello, world!";中, 如果我们定义的构造函数为如下, 则就是隐式调用构造方法,...
1674 0

热门文章

最新文章