Archived
This forum has been archived. Please start a new discussion on GitHub.
problems of sequence?
my ice file is defined as below, but when compiling, there are errors, why?
thks!
// **********************************************************************
//
// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
#ifndef COMMON_M
#define COMMON_M
module Common
{
class CFuncMenu
{
string funcID;
string levelID;
string levelName;
string parentID;
string instanceName;
sequence<CFuncMenu> funcChildren;
};
};
#endif
thks!
// **********************************************************************
//
// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
#ifndef COMMON_M
#define COMMON_M
module Common
{
class CFuncMenu
{
string funcID;
string levelID;
string levelName;
string parentID;
string instanceName;
sequence<CFuncMenu> funcChildren;
};
};
#endif
0
Comments
-
Hi,
You need to define the sequence first, for example:// Slice module Common { sequence<CFuncMenu> CFuncMenuSeq; class CFuncMenu { string funcID; string levelID; string levelName; string parentID; string instanceName; CFuncMenuSeq funcChildren; }; }
Cheers,
Benoit.0 -
there are still errors as blow:
:/work/Projects/qta/Interface/Common.ice:15: `CFuncMenu' is not defined
:/work/Projects/qta/Interface/Common.ice:24: `CFuncMenuSeq' is not defined0 -
Sorry, you need to forward declare the CFuncMenu class for this to work. The following should work instead:
// Slice module Common { class CFuncMenu; sequence<CFuncMenu> CFuncMenuSeq; class CFuncMenu { string funcID; string levelID; string levelName; string parentID; string instanceName; CFuncMenuSeq funcChildren; }; };
0 -
thks very much, from this point of this, slice is very similar to c etc.
thks again.0