0

Possible Duplicate:
What does invalid initialization of non-const reference mean?

What does this error message mean?

invalid initialization of non-constant reference of the type »std::basic_string<char>&« of R-value of type »std::basic_string<char>&«

The error code:

void Dropbox_pluginAPI::acquireAccessToken(std::string &accessToken, std::string &accessTokenSecret)
{
     client->aqcuireAccessToken(accessToken,accessTokenSecret);
}
Community
  • 1
  • 1
Tobi Weißhaar
  • 1,617
  • 6
  • 26
  • 35
  • 1
    That's not enough code to tell the source of the problem. What is client? – Luchian Grigore Jan 31 '12 at 10:21
  • Is there invocations similar to `Dropbox_pluginAPI::acquireAccessToken("abc", "def");` or `Dropbox_pluginAPI::acquireAccessToken(std::string("abc"), std::string("def"));` ? – hmjd Jan 31 '12 at 10:24
  • the client is very comlicated it is an client that connect to Dbus...But I know that it is not a client issue...the invocations dont work – Tobi Weißhaar Jan 31 '12 at 10:28
  • Can you locate invocations of `Dropbox_pluginAPI::acquireAccessToken()`? What is the signature of `client->aqcuireAccessToken()`? – hmjd Jan 31 '12 at 10:32
  • void aqcuireAccessToken(std::string& accessToken, std::string& accessTokenSecret) – Tobi Weißhaar Jan 31 '12 at 10:34
  • I think I know the issue...I use firebreath to create a browser plugin and the plugin that is able to call "acquireAccessToken" and the plugin in javascript context can not pass references to the method... – Tobi Weißhaar Jan 31 '12 at 10:37
  • 2
    You cannot pass temporary `std::string` objects to either of those methods. Either change the signature of both methods to use `const std::string&` references only or don't pass temporaries to them. – hmjd Jan 31 '12 at 10:37

0 Answers0