错误:命名构造函数,而不是类型。使用 g++4.6.1 编译时

发布于 2024-12-19 07:47:24 字数 1844 浏览 5 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

悲念泪 2024-12-26 07:47:25

您应该使用类似的方法预处理源代码

g++ -C -E yoursource.cc | grep -v '^#' > yoursource.ii

grep -v 删除行编号)

,然后编译预处理后的表单,

g++ -Wall -c yoursource.ii

然后查看 yoursource.ii 中错误消息的位置code>

您还可以询问 [电子邮件受保护]

但正如其他人指出的那样,你的代码不是很漂亮......

You should preprocess your source code with something like

g++ -C -E yoursource.cc | grep -v '^#' > yoursource.ii

(the grep -v removes the line numbering)

then compile the preprocessed form with

g++ -Wall -c yoursource.ii

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...

饭团 2024-12-26 07:47:25

我想说的是,当你说:

DEFINE_ENGINE_PROPERTIES_INHERIT(Base::IOPS, ...  

你应该写:

DEFINE_ENGINE_PROPERTIES_INHERIT(Base, ...  

也就是说,没有::IOPS

I'd say that when you say:

DEFINE_ENGINE_PROPERTIES_INHERIT(Base::IOPS, ...  

You should write:

DEFINE_ENGINE_PROPERTIES_INHERIT(Base, ...  

That is, without the ::IOPS.

冬天的雪花 2024-12-26 07:47:24

如果您使用名称,则会给出此诊断信息。

myclass::myclass

该名称并不表示类 myclass,而是表示其构造函数

This diagnostic is given if you use the name

myclass::myclass

This name does not denote the class myclass but its constructor(s)

愛放△進行李 2024-12-26 07:47:24

它是一个限定名称,例如Base::IOPS,,在此之前我们需要有一个typename。您需要传递一个类型而不是限定名称Base::IOPS,因此我定义了一个类型

typedef Base::IOPS MYIOP 

,然后传递该类型,因此“这不是类型”的错误消失了。

It is a qualified name like Base::IOPS, we need to have a typename before that. You need to pass a type instead of qualified name Base::IOPS, so i defined a type

typedef Base::IOPS MYIOP 

and then passed that type, so the error "this is not a type" is gone.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文