Fail to build in Windows with ESP 4.4.6
Opened this issue · 1 comments
D:/Projetos/M5Stack/M5Cardputer-UserDemo/main/apps/app_ir/app_ir.cpp: In member function 'void MOONCAKE::APPS::AppIR::_update_state()':
D:/Projetos/M5Stack/M5Cardputer-UserDemo/main/apps/app_ir/app_ir.cpp:170:41: error: exception handling disabled, use -fexceptions to enable
catch(const std::exception& e)
^
D:/Projetos/M5Stack/M5Cardputer-UserDemo/main/apps/app_ir/app_ir.cpp:173:50: error: 'e' was not declared in this scope
spdlog::info("parse failed: {}", e.what());
^
[1129/1257] Building CXX object esp-idf/main/CMakeFiles/__idf_main.dir/apps/app_keyboard/app_keyboard.cpp.obj
In file included from D:/Projetos/M5Stack/M5Cardputer-UserDemo/main/apps/app_keyboard/app_keyboard.cpp:13:
d:\projetos\m5stack\m5cardputer-userdemo\main\apps\utils\wifi_common_test\wifi_common_test.h:19:17: warning: 'WIFI_COMMON_TEST::is_nvs_inited' defined but not used [-Wunused-variable]
static bool is_nvs_inited = false;
^~~~~~~~~~~~~
[1132/1257] Building CXX object esp-idf/main/CMakeFiles/__idf_main.dir/apps/app_repl/app_repl.cpp.obj
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
@jadielsousa
Error message you provided indicates that the ESP-IDF framework does not have exception handling enabled by default. You need to enable exceptions by adding the -fexceptions flag to your compiler settings.
Something like this set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
Since exception handling is not enabled, variable e
inside the catch experssion is not decleared, so the second error is caused error: 'e' was not declared in this scope
. Once you have fixed the issue mentioned above, it should be fine.