espressif / idf-eclipse-plugin

Espressif-IDE (based on Eclipse CDT) for ESP-IDF CMake based projects 4.x and above
Eclipse Public License 2.0
313 stars 121 forks source link

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

Open LonlyPan opened 2 months ago

LonlyPan commented 2 months ago

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); } }

5. 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 )


6. The purpose of steps 2、3 and 4 is to support C++ for project
7. then buid。 it will have Error message: “new file not found”,like this
![图像-20240814-204913](https://github.com/user-attachments/assets/576fe88d-9575-4112-839d-c7b914a4e7ba)

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 commented 2 months ago

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