类定义递归? [英] class definition recursion?

查看:82
本文介绍了类定义递归?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在VC ++ 6.0上编译一段代码...

在X-Code下在MAC OS X上编译好....

#include< list>

class myClass

{

private:

std :: string name;

std :: list< myClassobjects;


};

我试过把类myClass;在课程定义的前面,但它没有帮助......


错误...

C: \program files\microsoft visual studio \vc98 \include\list(29):错误

C2079:''_ Value''使用未定义的类''myClass''

C:\Documents and Settings\username \Desktop\deleteme

\ deleteme.cpp(15):参见类模板实例化的参考

''std :: list< class myClass,class std :: allocator< class myClass''

编译

c:\ program Files \ microsoft visual studio \\ \\ vc98 \include

\ functional(185):错误C2079:''value''使用未定义的类''myClass''

c:\ programprogram files \\ microsrosoft visual studio \vc98 \include

\ list(285):参见类模板实例化的参考

''std :: binder2nd< struct std :: not_equal_to< class myClass''是编译

编译

C:\Documents and Settings\user\Desktop\deleteme

\ deleteme.cpp(15) :请参阅类模板实例化的引用

''std :: list< class myClass,class std :: allocator< class myClass''

编译

I am having trouble getting a piece of code to compile on VC++ 6.0...
Compiles fine on MAC OS X under X-Code....
#include <list>
class myClass
{
private:
std::string name;
std::list<myClassobjects;

};
I tried putting class myClass; in front of the class definition but it
didn''t help...

errors...
C:\program files\microsoft visual studio\vc98\include\list(29) : error
C2079: ''_Value'' uses undefined class ''myClass''
C:\Documents and Settings\username\Desktop\deleteme
\deleteme.cpp(15) : see reference to class template instantiation
''std::list<class myClass,class std::allocator<class myClass'' being
compiled
c:\program files\microsoft visual studio\vc98\include
\functional(185) : error C2079: ''value'' uses undefined class ''myClass''
c:\program files\microsoft visual studio\vc98\include
\list(285) : see reference to class template instantiation
''std::binder2nd<struct std::not_equal_to<class myClass'' being
compiled
C:\Documents and Settings\user\Desktop\deleteme
\deleteme.cpp(15) : see reference to class template instantiation
''std::list<class myClass,class std::allocator<class myClass'' being
compiled

推荐答案

2007-06-14 17:48,SpreadTooThin写道:
On 2007-06-14 17:48, SpreadTooThin wrote:

I我无法在VC ++ 6.0上编写一段代码进行编译...

在X-Code下编译好的MAC OS X ....


#include< list>

class myClass

{

private:

std :: string name;

std :: list< myClassobjects;


};


我试过把类myClass;在课程定义的前面,但它没有帮助...
I am having trouble getting a piece of code to compile on VC++ 6.0...
Compiles fine on MAC OS X under X-Code....
#include <list>
class myClass
{
private:
std::string name;
std::list<myClassobjects;

};
I tried putting class myClass; in front of the class definition but it
didn''t help...



除了忘记包括< stringit外观对我好任何

使用VC ++ 6的特殊原因,如果没有去获得VC ++ 2005 Express和

它将起作用。


-

Erik Wikstr?m

Except for having forgotten to include <stringit looks fine to me. Any
special reason for using VC++ 6, if not go and get VC++2005 Express and
it will work.

--
Erik Wikstr?m


6月14日上午8:48,SpreadTooThin< bjob​​rie ... @ gmail.comwrote :
On Jun 14, 8:48 am, SpreadTooThin <bjobrie...@gmail.comwrote:

我无法在VC ++ 6.0上编译代码...

在X下的MAC OS X上编译正常-Code ....


#include< list>

class myClass

{
$ b $私人:

std :: string name;

std :: list< myClassobjects;


};


我试过把类myClass;在课程定义的前面,但它没有帮助......


错误...

C: \program files\microsoft visual studio \vc98 \include\list(29):错误

C2079:''_ Value''使用未定义的类''myClass''

C:\Documents and Settings\username \Desktop\deleteme

\ deleteme.cpp(15):参见类模板实例化的参考

''std :: list< class myClass,class std :: allocator< class myClass''

编译

c:\ program Files \ microsoft visual studio \\ \\ vc98 \include

\ functional(185):错误C2079:''value''使用未定义的类''myClass''

c:\ programprogram files \\ microsrosoft visual studio \vc98 \include

\ list(285):参见类模板实例化的参考

''std :: binder2nd< struct std :: not_equal_to< class m yClass''

编译

C:\Documents and Settings\user\Desktop\deleteme

\ deleteme.cpp (15):参见类模板实例化

''std :: list< class myClass,class std :: allocator< class myClass''

编译
I am having trouble getting a piece of code to compile on VC++ 6.0...
Compiles fine on MAC OS X under X-Code....

#include <list>
class myClass
{
private:
std::string name;
std::list<myClassobjects;

};

I tried putting class myClass; in front of the class definition but it
didn''t help...

errors...
C:\program files\microsoft visual studio\vc98\include\list(29) : error
C2079: ''_Value'' uses undefined class ''myClass''
C:\Documents and Settings\username\Desktop\deleteme
\deleteme.cpp(15) : see reference to class template instantiation
''std::list<class myClass,class std::allocator<class myClass'' being
compiled
c:\program files\microsoft visual studio\vc98\include
\functional(185) : error C2079: ''value'' uses undefined class ''myClass''
c:\program files\microsoft visual studio\vc98\include
\list(285) : see reference to class template instantiation
''std::binder2nd<struct std::not_equal_to<class myClass'' being
compiled
C:\Documents and Settings\user\Desktop\deleteme
\deleteme.cpp(15) : see reference to class template instantiation
''std::list<class myClass,class std::allocator<class myClass'' being
compiled



适合我。我现在使用的是Visual C ++ 2005 Express Edition。

Works for me. I am using Visual C++ 2005 Express Edition though.


6月14日上午10点40分,Erik Wikstr?m< Erik-wikst ...... @ telia.comwrote:
On Jun 14, 10:40 am, Erik Wikstr?m <Erik-wikst...@telia.comwrote:

2007-06-14 17:48,SpreadTooThin写道:
On 2007-06-14 17:48, SpreadTooThin wrote:

我在获取一段代码以便在VC ++ 6.0上编译时遇到了麻烦...

在X-Code下编译好MAC OS X ....
I am having trouble getting a piece of code to compile on VC++ 6.0...
Compiles fine on MAC OS X under X-Code....


#include< list>

class myClass

{

private:

std :: string name;

std :: list< myClassobjects;
#include <list>
class myClass
{
private:
std::string name;
std::list<myClassobjects;


};
};


我试过把类myClass;在课程定义的前面,但它没有帮助...
I tried putting class myClass; in front of the class definition but it
didn''t help...



除了忘记包括< stringit外观对我好任何

使用VC ++ 6的特殊原因,如果没有去获得VC ++ 2005 Express和

它将起作用。


-

Erik Wikstr?m


Except for having forgotten to include <stringit looks fine to me. Any
special reason for using VC++ 6, if not go and get VC++2005 Express and
it will work.

--
Erik Wikstr?m



是的你的权利我忘了在这里发布< stringin ..但是

不在代码中。

我正在尝试编写跨平台代码..对于windows和mac os

x ...

我在windozs上开发的所有内容都是Visual C ++ 6.0


申请......

Yes your right i forgot to include <stringin the posting here.. but
not in the code.
Well I''m trying to write cross platform code.. for windows and mac os
x...
All I have for development on windozs is Visual C++ 6.0

Just curious but the application I tried to make was a win32 console
application...


这篇关于类定义递归?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆