类命名空间不明确问题

发布于 2024-09-08 23:45:00 字数 729 浏览 2 评论 0原文

我觉得问这个问题真的很傻,但我不知道如何解决这个问题。

这是我的代码(Objective-C++)的一个小片段:

#include "eq/eq.h"
namespace eqOther
{
    class Window : public eq::Window //<-- Error occurs here
    {
    public:
        Window( eq::Pipe* parent ) : eq::Window( parent ) {}

        void popup();

    protected:
        virtual ~Window() {}

        virtual bool processEvent( const eq::Event& event );

    private:

    };
}

我得到的错误是:Use of 'Window' is ambigacy 并且它说它在 Xh 中声明为 typedef XID Window 并在 window.h 中作为 class eq::Window ,这是它的超类。

我声明的类应该位于命名空间 eqOther 中,是吗? eqOther::Windoweq::Window 不同!?

我觉得自己很愚蠢,但我就是不明白我做错了什么......

I... feel really silly asking this, but I'm not sure how to resolve the problem.

This is a little snippit of my code (Objective-C++):

#include "eq/eq.h"
namespace eqOther
{
    class Window : public eq::Window //<-- Error occurs here
    {
    public:
        Window( eq::Pipe* parent ) : eq::Window( parent ) {}

        void popup();

    protected:
        virtual ~Window() {}

        virtual bool processEvent( const eq::Event& event );

    private:

    };
}

And the error I'm getting is: Use of 'Window' is ambiguous and it says it's declared in X.h as typedef XID Window and in window.h as class eq::Window which is its superclass.

The class I'm declaring should be in namespace eqOther yea? eqOther::Window is different than eq::Window!?

I feel soooo dumb, but I just don't see what I've done wrong...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

怪异←思 2024-09-15 23:45:00

也许您的标头中某处有一些 using namespace eq;

Perhaps you have some using namespace eq; somewhere in your headers

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