错误:命名构造函数,而不是类型。使用 g++4.6.1 编译时
我在 aix6.1 上使用 g++4.6.1 编译代码并收到此错误:-
ViaChecks.h:14:3: error: 'BuPolygonEX<AllPass<CornerT<NetAndVal<ZVal3> > > >::IOPS::Base {aka BuPolygonCore<bu_polygon_clean_func, no_derivatives, AllPass<CornerT<NetAndVal<ZVal3> > > >::IOPS}::IOPS' names the constructor, not the type
结构定义为:
struct ViaSquareCheck : BuPolygonEX<AllPass<CornerT<NetAndVal<ZVal3> > > > {
typedef BuPolygonEX<AllPass<CornerT<NetAndVal<ZVal3> > > > Base;
DEFINE_ENGINE_PROPERTIES_INHERIT(Base::IOPS, void update() { Base::update(); i().xregion_1nm_oversize(x0nm); o().xregion_1nm_oversize(x0nm); o().derivatives(x_dom); o().bu_polygonized(yes); }); // via_square_dim property is added inside
membert(int, amount, -1, ViaSquareCheck);
ViaSquareCheck();
ViaSquareCheck* output(DFC* dfc) { return set_output(0,dfc); } // single output returns good vias
ViaSquareCheck* set_output(int k, DFC* dfc);
void option(const string& pname, const string& pval); // some options change engine properties
private:
BadViaMultiplexer<C>* mux;
GIM2a<APC> bad_via_gim;
GIM2a<APC> good_via_gim;
member(bool, linked, false);
member(bool, ok_45, false);
void link();
member(ViaSquareCheckNetProcess*, np,NULL);
};
DEFINE_ENGINE_PROPERTIES_INHERIT 的定义:-
#define DEFINE_ENGINE_PROPERTIES_INHERIT(SSSS, extras...) \
struct IOPS : SSSS { \
EnginePropertiesVector& i() { return SSSS::i(); }; \
EnginePropertiesVector& o() { return SSSS::o(); }; \
EngineProperties& i(int n) { return SSSS::i(n); }; \
EngineProperties& o(int n) { return SSSS::o(n); }; \
typedef SSSS Base; \
extras; } ep_;
谢谢。
I am compiling the code with g++4.6.1 on aix6.1 and getting this error:-
ViaChecks.h:14:3: error: 'BuPolygonEX<AllPass<CornerT<NetAndVal<ZVal3> > > >::IOPS::Base {aka BuPolygonCore<bu_polygon_clean_func, no_derivatives, AllPass<CornerT<NetAndVal<ZVal3> > > >::IOPS}::IOPS' names the constructor, not the type
The structure is defined as :
struct ViaSquareCheck : BuPolygonEX<AllPass<CornerT<NetAndVal<ZVal3> > > > {
typedef BuPolygonEX<AllPass<CornerT<NetAndVal<ZVal3> > > > Base;
DEFINE_ENGINE_PROPERTIES_INHERIT(Base::IOPS, void update() { Base::update(); i().xregion_1nm_oversize(x0nm); o().xregion_1nm_oversize(x0nm); o().derivatives(x_dom); o().bu_polygonized(yes); }); // via_square_dim property is added inside
membert(int, amount, -1, ViaSquareCheck);
ViaSquareCheck();
ViaSquareCheck* output(DFC* dfc) { return set_output(0,dfc); } // single output returns good vias
ViaSquareCheck* set_output(int k, DFC* dfc);
void option(const string& pname, const string& pval); // some options change engine properties
private:
BadViaMultiplexer<C>* mux;
GIM2a<APC> bad_via_gim;
GIM2a<APC> good_via_gim;
member(bool, linked, false);
member(bool, ok_45, false);
void link();
member(ViaSquareCheckNetProcess*, np,NULL);
};
Definition of DEFINE_ENGINE_PROPERTIES_INHERIT:-
#define DEFINE_ENGINE_PROPERTIES_INHERIT(SSSS, extras...) \
struct IOPS : SSSS { \
EnginePropertiesVector& i() { return SSSS::i(); }; \
EnginePropertiesVector& o() { return SSSS::o(); }; \
EngineProperties& i(int n) { return SSSS::i(n); }; \
EngineProperties& o(int n) { return SSSS::o(n); }; \
typedef SSSS Base; \
extras; } ep_;
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您应该使用类似的方法预处理源代码
(
grep -v
删除行编号),然后编译预处理后的表单,
然后查看
yoursource.ii
中错误消息的位置code>您还可以询问
[电子邮件受保护]
。但正如其他人指出的那样,你的代码不是很漂亮......
You should preprocess your source code with something like
(the
grep -v
removes the line numbering)then compile the preprocessed form with
then look at the locations of the error message in
yoursource.ii
You might also ask on
[email protected]
.But as others pointed out, your code is not very pretty...
我想说的是,当你说:
你应该写:
也就是说,没有
::IOPS
。I'd say that when you say:
You should write:
That is, without the
::IOPS
.如果您使用名称,则会给出此诊断信息。
该名称并不表示类
myclass
,而是表示其构造函数This diagnostic is given if you use the name
This name does not denote the class
myclass
but its constructor(s)它是一个限定名称,例如
Base::IOPS,
,在此之前我们需要有一个typename
。您需要传递一个类型而不是限定名称Base::IOPS
,因此我定义了一个类型,然后传递该类型,因此“这不是类型”的错误消失了。
It is a qualified name like
Base::IOPS,
we need to have atypename
before that. You need to pass a type instead of qualified nameBase::IOPS
, so i defined a typeand then passed that type, so the error "this is not a type" is gone.