我正在尝试创建一个简单的消息定义包含一个使用实现的字段std::vector
。
根据OMNet++ 5.5 手册第 1 章6秒。 8.1,这看起来很简单。
However, I'm using OMNet++ 6.0pre6: I can't figure out what the correct way of doing this is, as the manual is out of date1, and the changes are very superficially referred to in the nedxml
changelog.
消息定义可以归结为手册中的确切示例,但在本例中它是一个message
而不是一个packet
(都会产生相同的错误):
cplusplus {{
#include <vector>
typedef std::vector<int> IntVector;
}}
class noncobject IntVector;
message SimpleMsg {
int this_thing;
int that_thing;
IntVector these_things;
}
以下错误由提供者提供opp_msgtool
,消息到 C++ 转译器:
SimpleMsg.msg:6: Error: Type declarations are not needed with imports, try invoking the message compiler in legacy (4.x) mode using the --msg4 option
SimpleMsg.msg:11: Error: unknown type 'IntVector' for field 'these_things' in 'SimpleMsg'
思维导入不需要类型声明可能是 OMNet 5.x 到 6.x 变化的简单总结,我继续删除class noncobject IntVector
。虽然它消除了第一个错误,但它仍然会产生Error: unknown type 'IntVector' for field 'these_things' in 'SimpleMsg'
.
有想法吗?建议?应该吸取的教训?
EDIT: 值得注意的是,发现中有一些注释nedxml更改日志涉及 4.0-5.x 和 6.0 之间的更改,但如何理想地使用它还不太清楚。
1 Certainly not wholly applicable to OMNet++ 6.0 at the very least.