I’m trying to update my native extension Look like things have changed
Having a “cannot use ‘throw’ with exceptions disabled” error. I try to add “-fexceptions”, “-fcxx-exceptions” flags but they are invalid. seems like bundling for Windows is works but not for mac or linux. Am I missing something?
Well, in general game engines don’t use exceptions, and we’re not either. We use “-fno-exceptions” and “-fno-rtti”. These are part of the command line when building the extensions.
What do you need exceptions for in this case?
Yes, the DLIB_LOG_DOMAIN warning is annoying, and it should be fixed in the next release (1.2.137)
Well, if it’s an actual programmer error, I would call assert().
If it’s a user defined error, I would check those much higher up in the code. E.g. in this case in the Lua bindings, and then return luaL_error(L, "msg")
Hi @Mathias_Westerdahl
I come across this problem again and this time I hit the wall.
One of the lib that I’m using is Msgpack. Which is widely used binary serialization format especially for websocket data. Lib contains many exceptions. I can change them one by one of course but that is not a pleasant way.
Is there any other workaround which you can suggest?
Thank you @sven.
Actually this is a generic question and not just about the msgpack.
Maybe using C version is an option but It cause me to change entire code
In general, games do not use exceptions due to the extra overhead in performance (and code bloat).
We too build without exceptions, and would encourage others to do so as well.
As @sven suggests, I would personally go for using the C version. It’s most likely not that much to change.I think fiddling with the defines as you try to is a slippery slope.
Next week, I’m going to start documenting Native Extensions a bit more, including this bit too.