Undefined symbols for architecture i386:
“js::IsInRequest(JSContext*)”, referenced from:
JS::Rooted<JSObject*>::Rooted(JSContext*, mozilla::detail::GuardObjectNotifier const&) in jsb_mp_auto.o
JS::RootedJS::Value::Rooted(JSContext*, mozilla::detail::GuardObjectNotifier const&) in jsb_mp_auto.o
ld: symbol(s) not found for architecture i386
I don’t know exactly why you are getting this error, but I didn’t see any usage of js::IsInRequest in your code, so if you can post the code where triggered the error, it may be easier to track down the reason.
I don’t think this will work with 3.0, because JSBool etc have been replaced with bool and I guess there are other changes too. This is happening with both auto and manual custom bindings. For example, i tried to create the following manual bindings.
Undefined symbols for architecture i386:
"js::IsInRequest(JSContext*)", referenced from:
JS::Rooted<JSObject*>::Rooted(JSContext*, mozilla::detail::GuardObjectNotifier const&) in eureekah.o
JS::Rooted<JS::Value>::Rooted(JSContext*, mozilla::detail::GuardObjectNotifier const&) in eureekah.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
@pandamicro I didn’t add extra code. Just add this single line:
JS::Rooted nsval(cx);
in debug mode and it will report linking error.
BTW, I’ve got it through in release mode. As cocos2d-js 3.0 doesn’t support 64bit release mode, I have to switch to 32bit mode and release it.
And it works!
The strange thing is, if I write the same code and do the binding in the jsb library it will not report error. But if I write code and do the binding in the project’s folder(e.g… classes folder), it will report error if I don’t use release mode.
js::IsInRequest is only available in release mode, that’s why you don’t get any error in release mode.
Our spider monkey have been compiled in release mode, but it defined an DEBUG preprocessor macro, you need to remove it from the project settings.
Find preprocessor macro in the build settings of your project, if you find a macro named DEBUG, you should remove it.
Try to test if it works for you, if not, please keep us noticed.
I have the same question about how to manually create usb in cocos2dx 3.0. I don’t know how to update the JSB_AUTO.cpp for cocos2d-js version 3.0. Is there any template or example to demonstrate how to work?
AppDelegate.cpp:106:25: error:
cannot initialize a parameter of type ‘sc_register_sth’ (aka ‘void
(*)(JSContext *, Handle<JSObject *>)’) with an lvalue of type ‘void
(JSContext *, JSObject *)’: type mismatch at 2nd parameter
(‘JS::HandleObject’ (aka ‘Handle<JSObject *>’) vs ‘JSObject *’)
sc->addRegisterCallback(register_all);
i have this error !!
Can u help me please