声明类和命名空间时出现问题

Problems declaring classes and namespace

本文关键字:问题 命名空间 声明      更新时间:2023-10-16

我声明了一个这样的类:

#include "BindableInterface.h"
#include "../LuaHelper.h"
#include <map>
#include <string>
namespace utils{
    class CLuaHelper;
};
namespace zel{
    namespace utils{
        class CAPIBindManager
        {
            typedef std::map<std::string, CBindeableInterface*> t_exposedClassMap;
            t_exposedClassMap m_classesToExpose;
            utils::CLuaHelper* m_luaHelper;
        public:
            bool exportClasses(const unsigned char* data);
            bool executeLuaChunk(const std::string fileName, const std::string funtionName);
            bool addClassToExpose(CBindeableInterface* bindableInterface, const std::string alias);
            CAPIBindManager(void);
            ~CAPIBindManager(void);
        };
    };
};

但是我得到一个编译错误,即CLuaHelper不是zel::utils的成员。CLuaHelper 被声明为 utils::CLuaHelper (不带 zel) 我需要如何声明这个类。 AFAIK,前向声明可能会解决这个问题

任何想法??

使用 ::utils::CLuaHelper 来区分两个utils命名空间。