Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to build in Windows with ESP 4.4.6 #24

Open
jadielsousa opened this issue Oct 24, 2024 · 1 comment
Open

Fail to build in Windows with ESP 4.4.6 #24

jadielsousa opened this issue Oct 24, 2024 · 1 comment

Comments

@jadielsousa
Copy link

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

@JohnZ03
Copy link

JohnZ03 commented Oct 25, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants