Cocos2d-x c++ exceptions

Cocos2d-x c++ exceptions
0

#1

Hey,

I’ve recently tried to work with c++17 std::variant in my cocos2d-x project, and in order to be able to compile it on OSX/iOS without setting the minor deployment target to the latest version I have to disable c++ exceptions due to a std::visit bad_variant_access exception https://stackoverflow.com/questions/52310835/xcode-10-call-to-unavailable-function-stdvisit

I’ve always thought cocos2d-x has turned exceptions off by default?

Did this change at some point? or are my project settings incorrect.

I’ve recently tried to simply turn them off but ran into some issues with the engine.


#2

I believe it doesn’t use any exception code (or used to not use any) so you could disable exceptions in your game if desired, but I do believe they’re enabled by default (or prob. technically uses build system default).

Can you see where in the engine source the errors/warnings occur when disabling exceptions?