title: Calling C++ member function from Luabind causes "No matching overload found"
body: <p>I've got some classes exported to Luabind in a DLL, and everything is working fine for those 2 classes (LuaScriptManager, EventManager).
  I can call their functions from Lua and all is well, but now I'm trying to setup some new class in my client executable which links with the DLL and so far no luck at all.</p>
  
  <p>Here's the error message I get for every function that I call:
  "No matching overload found, candidates: void loadResource(ResourceManager&amp;, std::string const&amp;)"</p>
  
  <p>The class binding is from <a href="http://www.nuclex.org/articles/5-cxx/1-quick-introduction-to-luabind" rel="nofollow">http://www.nuclex.org/articles/5-cxx/1-quick-introduction-to-luabind</a>:</p>
  
  <pre><code>struct Manager {
  Manager() :
  m_ResourceCount(0) {}
  
  void loadResource(const std::string &amp;sFilename) {
  ++m_ResourceCount;
  }
  size_t getResourceCount() const {
  return m_ResourceCount;
  }
  
  size_t m_ResourceCount;
  };
  static Manager MyResourceManager;
  
  void Bind(lua_State* l)
  {
      // Export our class with LuaBind
      luabind::module(l) [
      luabind::class_&lt;Manager&gt;("ResourceManager")
      .def("loadResource", &amp;Manager::loadResource)
      .property("ResourceCount", &amp;Manager::getResourceCount)
      ];
  
      luabind::globals(l)["MyResourceManager"] = &amp;MyResourceManager;
  }
  </code></pre>
  
  <p>And here's the corresponding lua test code:</p>
  
  <pre><code>-- The following call will fail with the above error
  MyResourceManager:loadResource("abc.res")
  --MyResourceManager:loadResource("xyz.res")
  
  -- If the function is commented out, this will work (accessing the property)
  ResourceCount = MyResourceManager.ResourceCount
  
  -- Calling my other classes' functions work fine
  LuaScriptManager.GetInstance():WriteLine(ResourceCount)
  </code></pre>
  
  <p>What could be the cause of this strange behavior ?</p>