idf-eclipse-plugin icon indicating copy to clipboard operation
idf-eclipse-plugin copied to clipboard

Espressif IDE 3.0.0 with idf 5.3 c++ Project `include <new>` error in windows (IEP-1306)

Open LonlyPan opened this issue 1 year ago • 1 comments

Describe the bug Espressif IDE 3.0.0 with idf 5.3 c++ Project include <new> error in windows。 But it is ok with vscode in windows。and is ok in macbook too.

To Reproduce Steps to reproduce the behavior:

  1. in windows use Espressif IDE , creat a new project use template “sample_project”
  2. Rename the main.c to main.cpp
  3. Modify the content of main.cpp。like this
extern "C" 
{
#include <stdio.h>
#include <stdbool.h>
#include <unistd.h>
}
#include <new>

extern "C" void app_main(void)
{
    while (true) {
        printf("Hello from app_main!\n");
        sleep(1);
    }
}
  1. Modify the content of CMakeLists.txt in main floder,like this
idf_component_register(
    SRCS main.cpp         # list the source files of this component
    INCLUDE_DIRS        # optional, add here public include directories
    PRIV_INCLUDE_DIRS   # optional, add here private include directories
    REQUIRES            # optional, list the public requirements (component names)
    PRIV_REQUIRES       # optional, list the private requirements
)
  1. The purpose of steps 2、3 and 4 is to support C++ for project
  2. then buid。 it will have Error message: “new file not found”,like this 图像-20240814-204913

If you use the same steps use vscode in windows or use espressif ide in macbook,it will be fine,build successfull。 I think should be some think wrong with espressif ide in windows

This is my test project file: https://github.com/LonlyPan/esp32_lvgl_test_with_flow/tree/main/test2

LonlyPan avatar Aug 14 '24 12:08 LonlyPan

I alse test Espressif IDE 3.0.0 with idf 5.2.2, The problem is the same。

LonlyPan avatar Aug 14 '24 13:08 LonlyPan