Skip to content

Fail to build in Windows with ESP 4.4.6 #24

Closed

Description

@jadielsousa

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

Activity

  1. JohnZ03 commented on Oct 25, 2024

    @JohnZ03

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

  2. Forairaaaaa commented on Nov 5, 2026

    @Forairaaaaa
    Contributor

    Tested with ESP-IDF v4.4.6 under WSL. The full firmware builds successfully with the repository’s sdkconfig. Disabling C++ exceptions reproduces the exact errors reported here.

    Please run idf.py menuconfig, enable Compiler options → Enable C++ exceptions (CONFIG_COMPILER_CXX_EXCEPTIONS=y), save, then run:

    idf.py fullclean build

    This option is already enabled in the repository’s configuration. Closing as a configuration issue. If the problem persists with exceptions enabled, please reopen and share your sdkconfig and full build log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions