I add emscripten:: before funciont in emscripten bind.
It's ok now.
Thanks a lot. : )
EMSCRIPTEN_BINDINGS(aaa) {
*emscripten::*function("Broadcast", &Broadcast);
*emscripten::*function("Login1", &Login);
}
Bruce Mitchener於 2014年1月23日星期四UTC+8下午4時49分15秒寫道:
>
> Is that supposed to be std::function or emscripten::function? You can
> disambiguate it by specifying the namespace, no?
>
> - Bruce
>
> On Thu, Jan 23, 2014 at 3:39 PM, ShunXung Yang <[email protected]<javascript:>
> > wrote:
>
>> I try to compile cpp to js with embind. But I met some problems.
>>
>> The error message below shows that there are "ambiguous" functions in my
>> code. But I only have ONE "Broadcast"&"Login" function defined there.
>>
>> any comments?
>>
>>
>> DeviceDiscover.cpp:101:2: error: reference to 'function' is ambiguous
>> function("Broadcast", &Broadcast);
>> ^
>> /home/shunxung/emscripten/system/include/libcxx/functional:1244:49: note:
>> candidate found by name lookup is
>> 'std::__1::function'
>> template<class _Fp> class _LIBCPP_TYPE_VIS_ONLY function; // undefined
>> ^
>> /home/shunxung/emscripten/system/include/emscripten/bind.h:297:10: note:
>> candidate found by name lookup is
>> 'emscripten::function'
>> void function(const char* name, ReturnType (*fn)(Args...),
>> Policies...) {
>> ^
>> DeviceDiscover.cpp:102:2: error: reference to 'function' is ambiguous
>> function("Login", &Login);
>> ^
>> /home/shunxung/emscripten/system/include/libcxx/functional:1244:49: note:
>> candidate found by name lookup is
>> 'std::__1::function'
>> template<class _Fp> class _LIBCPP_TYPE_VIS_ONLY function; // undefined
>> ^
>> /home/shunxung/emscripten/system/include/emscripten/bind.h:297:10: note:
>> candidate found by name lookup is
>> 'emscripten::function'
>> void function(const char* name, ReturnType (*fn)(Args...),
>> Policies...) {
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "emscripten-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
--
You received this message because you are subscribed to the Google Groups
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.