I have a C++ method that takes one variable the method signature is like this:
DLL returnObject** getObject( const std::string folder = "" );
I tried passing in:
const std::string myString = "something";
but I get the following error:
No matching function call to ... getObject( std::string&);
I have a couple questions here.
- How do I pass in a normal
std::stringwithout the& - This looks like the value is optional
folder = ""is it? And if so how do you pass an optional parameter?
getObjectfunction with the parameter? I'm betting your issue is there.extern "C"would help?const(although it is possible). What's more, your error message is referring to a function taking the string by non-constreference - which is a completely different one. So post the real code.