Jump to content
  • Advertisement
Sign in to follow this  
BasicMind

Nested Namespaces

This topic is 1101 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have an issue where if I use nested namespace I can't access them with-in a method.

r = e->SetDefaultNamespace("dev::log");
r = e->RegisterGlobalFunction("void info(const ::string &in)",    asFUNCTION(util::log_info),    asCALL_CDECL); assert(r >= 0);
r = e->RegisterGlobalFunction("void warning(const ::string &in)", asFUNCTION(util::log_warning), asCALL_CDECL); assert(r >= 0);
r = e->RegisterGlobalFunction("void error(const ::string &in)",   asFUNCTION(util::log_error),   asCALL_CDECL); assert(r >= 0);

If I run this function this works.

void main()
{
  dev::log::info("doop");
  dev::log::warning("doop");
  dev::log::error("doop");
}

But if I instance and run huh().

class Test
{
  void huh()
  {
    dev::log::info("Hi");
  } 
}

I get the error

ERR  : Namespace 'dev' doesn't exist.

Error doesn't happen with one level of namespaces, ie. just 'log'

Have I done something incorrect?

 

Share this post


Link to post
Share on other sites
Advertisement

Nothing to so in the first place.

 

some guesses:

 

Missing header file?

In which namespace is class Test?

Share this post


Link to post
Share on other sites

I've fixed this bug in revision 2207.

 

If you do not wish to upgrade to the latest WIP I believe you can work around the problem by adding 'r = e->SetDefaultNamespace("dev");' to explicitly register the 'dev' namespace too.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!