Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/164.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 声明类和命名空间时出现问题_C++_Namespaces - Fatal编程技术网

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

C++ 声明类和命名空间时出现问题,c++,namespaces,C++,Namespaces,我声明的类如下: #include "BindableInterface.h" #include "../LuaHelper.h" #include <map> #include <string> namespace utils{ class CLuaHelper; }; namespace zel{ namespace utils{ class CAPIBindManager { typed

我声明的类如下:

#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);
        };
    };
};
#包括“BindableInterface.h”
#包括“./LuaHelper.h”
#包括
#包括
命名空间utils{
CLuaHelper类;
};
名称空间zel{
命名空间utils{
班主任
{
typedef std::map t_exposedClassMap;
t_exposedClassMap m_classesToExpose;
utils::CLuaHelper*m_luaHelper;
公众:
bool exportClasses(常量无符号字符*数据);
bool executeLuaChunk(const std::string fileName,const std::string funtionName);
bool addClassToExpose(cbindableInterface*bindableInterface,const std::string别名);
CAPIBindManager(无效);
~CAPIBindManager(无效);
};
};
};
但是我得到了一个编译错误,即CLuaHelper不是zel::utils的成员。CLuaHelper被声明为utils::CLuaHelper(没有zel)我需要如何声明这个类。好吧,转发声明可能会解决这个问题


任何想法???

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

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

尝试
::utils::CLuaHelper*m\u luaHelper::我相信utils将从全局范围开始查找,而utils::将从本地范围开始查找try
::utils::CLuaHelper*m_luaHelper::我相信utils将从全局范围开始查找,而utils::将从本地范围开始查找。这正是我所需要的。非常感谢。这正是我需要的。非常感谢。