Killrazor
Killrazor

Reputation: 7176

Problems declaring classes and namespace

I'm declaring a class like this:

#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);
        };
    };
};

But I got a compiling error that CLuaHelper is not a member of zel::utils. CLuaHelper is declared as utils::CLuaHelper (without zel) How do I need to declare this class. AFAIK, the forward declaration might solve this problem

Any ideas??

Upvotes: 0

Views: 118

Answers (1)

Erik
Erik

Reputation: 91270

Use ::utils::CLuaHelper to distinguish in between the two utils namespaces.

Upvotes: 5

Related Questions