title: Registering a class' function in LuaBridge, then calling it via a lua script?
body: <p>Whenever I run the program, it prints nothing to the console.
  This works fine if I don't use a class and just do it all in main().</p>
  
  <p>The moment I put it in a class, I start having problems.
  What am I doing wrong?</p>
  
  <pre><code>using namespace luabridge;
  
  myClass::myClass()
  {
      lua_State* L = luaL_newstate();
      luaL_openlibs(L);
      getGlobalNamespace(L).beginClass&lt;myClass&gt;("myClass").addFunction("printMessage", &amp;myClass::printMessage).endClass();
      luaL_dofile(L, "test.lua");
      lua_pcall(L, 0, 0, 0);
  }
  
  void myClass::printMessage(const std::string&amp; s)
  {
      std::cout &lt;&lt; s &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>My lua script "test.lua"</p>
  
  <p>I've tried</p>
  
  <pre><code>c = myClass()
  c:printMessage("You can call C++ functions from Lua!")
  </code></pre>
  
  <p>and</p>
  
  <pre><code>myClass:printMessage("You can call C++ functions from Lua!")
  </code></pre>
  
  <p>and</p>
  
  <pre><code>printMessage("You can call C++ functions from Lua!")
  </code></pre>