2020-06-22 08:30 PM
I am trying to use try catch with cubeIDE. But get the error when compiling.
2020-06-23 02:20 AM
The error message says "use -fexceptions". Did you do it?
2020-06-23 02:39 AM
thank you for reply!,how to use "use -fexception"?
2020-06-23 05:18 AM
Right click the project -> Properties -> C/C++ Build -> Settings -> Tool Settings -> MCU G++ Compiler -> Miscellaneous
Add the "-fexceptions" flag there.
Not sure how well it'll work, but it will compile.
2023-04-14 04:29 AM - edited 2023-11-20 09:26 AM
Hi everyone,
As this link is the first one when looking for "stm32 try catch", I'm adding some extra info.
The previous answer doesn't work for me.
When looking on other thread, it turns out that the problem is linked with the "-specs=nano.specs".
A solution that works for me was to choose "Standard C, Standard C++" for the runtime library:
And:
And