我在声明这样的课程:
#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
名称空间。