2011-12-29 5 views
0

こんにちは私はfirebreathプロジェクトを作成しました。アプリケーションAPIヘッダファイル(MYAppAPI.h)でFirebreath MethodConverter.h無効な初期化

:私は、コードを生成し、デフォルトにこのメソッドを追加

FB_JSAPI_EVENT(bgp, 3, (const FB::variant&, bool, int)); 

std::string bgp(std::string& val); 

をアプリケーションAPIのソースファイル(MAppAPI.mmをIは、対物-Cを使用しています) :

registerMethod("bgp", make_method(this, &MyAppAPI::bgp)); 

std::string MyAppAPI::bgp(std::string& val){...} 

しかし、私は、コードをビルドするとき、私はこのエラーになっています:

... firebreath/SRC/ScriptingCore/MethodConverter.h:115:エラー:非const REFEの無効な初期化を'標準:::文字列&'の一時的な型から 'std :: basic_string、std :: allocator>'

のアイデアがありますか?読むべき

答えて

0

std::string MyAppAPI::bgp(const std::string& val){...} 

はconstの点に注意してください。参照でJS関数に渡すことはできないので、非const参照を渡すことはできません。

関連する問題