ESP32 Unresolved Inclusion on Hello World

MJ48574
Posts: 6
Joined: Sun Dec 29, 2019 8:17 am

ESP32 Unresolved Inclusion on Hello World

Postby MJ48574 » Sun Dec 29, 2019 8:35 am

I am running Windows 10 Build 1909. I followed instruction and created a new project from example code "hello_world" .
The project builds without any error.
I can run it and debug it Step Through it.
The only problem I have is that the include files are not resolved. Unresolved inclusion: "freertos/FreeRTOS.h"
Below is the list of components installed.
Eclipse 2019-12
ESP-IDF 3.3.1
And the following toolchain.
I get unresolved inclusion on all ESP32 include files only.
stdio.h include file is ok.

Executing C:\Users\HuaweiPC\AppData\Local\Programs\Python\Python37\python.exe C:\Users\HuaweiPC\esp\esp-idf\tools\idf_tools.py list
* xtensa-esp32-elf: Toolchain for Xtensa (ESP32) based on GCC
- 1.22.0-80-g6c4433a5-5.2.0 (recommended, installed)
* esp32ulp-elf: Toolchain for ESP32 ULP coprocessor
- 2.28.51.20170517 (recommended, installed)
* cmake: CMake build system
- 3.13.4 (recommended, installed)
* openocd-esp32: OpenOCD for ESP32
- v0.10.0-esp32-20190313 (recommended, installed)
* mconf: menuconfig tool
- v4.6.0.0-idf-20190628 (recommended, installed)
* ninja: Ninja build system
- 1.9.0 (recommended, installed)
* idf-exe: IDF wrapper tool for Windows
- 1.0.1 (recommended, installed)
* ccache: Ccache (compiler cache)
- 3.7 (recommended, installed)

chegewara
Posts: 2378
Joined: Wed Jun 14, 2017 9:00 pm

Re: ESP32 Unresolved Inclusion on Hello World

Postby chegewara » Tue Dec 31, 2019 12:19 am

You have to configure your IDE, since you can build example which means all required headers are in place.

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: ESP32 Unresolved Inclusion on Hello World

Postby ESP_Angus » Tue Dec 31, 2019 1:00 am

Hi MJ,

Are you using the IDF Eclipse plugin? https://github.com/espressif/idf-eclipse-plugin

As chegewara says, Eclipse needs a way to learn about all the source files and header include paths which are in use in the project in order to resolve paths in the editor. The IDF Eclipse plugin should do this once configured.

Angus

mylenedipenta
Posts: 9
Joined: Tue Dec 31, 2019 1:45 am

Re: ESP32 Unresolved Inclusion on Hello World

Postby mylenedipenta » Tue Dec 31, 2019 2:17 am

I have a similar problem. Eclipse plugin installed, configured according to https://github.com/espressif/idf-eclips ... /README.md. The compiler is clearly finding those files, because otherwise the build would fail.

The Hello World project contains this code. I am able to run and monitor the project, seeing that it returns correct information using components from esp_system.h (one of the files that isn't resolved).

Code: Select all

printf("This is ESP32 chip in Eclipse with %d CPU cores, WiFi%s%s, ",
            chip_info.cores,
            (chip_info.features & CHIP_FEATURE_BT) ? "/BT" : "",
            (chip_info.features & CHIP_FEATURE_BLE) ? "/BLE" : "");
Is it possible that the editor is somehow not resolving those references even though the compiler is?

My details:
Win10
ESP-IDF 4.0
Eclipse c/c++ 4.10.0

Eclipse IDF tools:
xtensa-esp32-elf esp-2019r2.8.2.0
esp32ulp-elf 2.28.51.20170517
cmake 3.13.4
openocd-esp32 v0.10.0-esp32-20190313
mconv v4.6.0.0-idf-20190628
ninja 1.9.0
idf-exe 1.0.1
ccache 3.7

chegewara
Posts: 2378
Joined: Wed Jun 14, 2017 9:00 pm

Re: ESP32 Unresolved Inclusion on Hello World

Postby chegewara » Tue Dec 31, 2019 3:55 am

mylenedipenta wrote: Is it possible that the editor is somehow not resolving those references even though the compiler is?
Yes. When ive been starting to work with esp32 ive been trying to use eclipse, now i prefer VS code because its much easier to work with.
My reference to start with eclipse was this example, which helped me with most of header inclusion in editor at the time:
https://github.com/nkolban/esp32-snippe ... cludes.xml

mylenedipenta
Posts: 9
Joined: Tue Dec 31, 2019 1:45 am

Re: ESP32 Unresolved Inclusion on Hello World

Postby mylenedipenta » Tue Dec 31, 2019 9:53 pm

Thanks. While I was working on a separate problem, I modified the file CMakeList (to add versioning) and when I rebuilt the project (which forced cmake to recreate the makefile), the #include statements resolved. The problem has not recurred, in this or other projects. Not sure if it's related or not, but it's working for now.

MJ48574
Posts: 6
Joined: Sun Dec 29, 2019 8:17 am

Re: ESP32 Unresolved Inclusion on Hello World

Postby MJ48574 » Wed Jan 01, 2020 10:02 pm

I modified MakeList.txt to add the include Directories. I still get Unresolved Inclusion.
set(COMPONENT_ADD_INCLUDEDIRS "."
$ENV{IDF_PATH}/components/vfs/include
$ENV{IDF_PATH}/components/spi_flash/include
$ENV{IDF_PATH}/components/bt/include
$ENV{IDF_PATH}/components/bt/bluedroid/bta/include
$ENV{IDF_PATH}/components/bt/bluedroid/bta/sys/include
$ENV{IDF_PATH}/components/bt/bluedroid/device/include
$ENV{IDF_PATH}/components/bt/bluedroid/hci/include
$ENV{IDF_PATH}/components/bt/bluedroid/osi/include
$ENV{IDF_PATH}/components/bt/bluedroid/btc/profile/esp/blufi/include
$ENV{IDF_PATH}/components/bt/bluedroid/btc/profile/esp/include
$ENV{IDF_PATH}/components/bt/bluedroid/btc/profile/std/include
$ENV{IDF_PATH}/components/bt/bluedroid/stack/include
$ENV{IDF_PATH}/components/bt/bluedroid/stack/l2cap/include
$ENV{IDF_PATH}/components/bt/bluedroid/stack/sdp/include
$ENV{IDF_PATH}/components/bt/bluedroid/stack/smp/include
$ENV{IDF_PATH}/components/bt/bluedroid/api/include
$ENV{IDF_PATH}/components/bt/bluedroid/btc/include
$ENV{IDF_PATH}/components/mdns/include
$ENV{IDF_PATH}/components/soc/esp32/include
$ENV{IDF_PATH}/components/aws_iot/include
$ENV{IDF_PATH}/components/aws_iot/aws-iot-device-sdk-embedded-C/include
$ENV{IDF_PATH}/components/fatfs/src
$ENV{IDF_PATH}/components/wear_levelling/include
$ENV{IDF_PATH}/components/esp32/include
$ENV{IDF_PATH}/components/newlib/include
$ENV{IDF_PATH}/components/freertos/include
$ENV{IDF_PATH}/components/nvs_flash/include
$ENV{IDF_PATH}/components/driver/include
$ENV{IDF_PATH}/components/log/include
$ENV{IDF_PATH}/components/tcpip_adapter/include
$ENV{IDF_PATH}/components/vfs/include
$ENV{IDF_PATH}/components/spi_flash/include
$ENV{IDF_PATH}/components/bt/include
$ENV{IDF_PATH}/components/bt/bluedroid/bta/include
$ENV{IDF_PATH}/components/bt/bluedroid/bta/sys/include
$ENV{IDF_PATH}/components/bt/bluedroid/device/include
$ENV{IDF_PATH}/components/bt/bluedroid/hci/include
$ENV{IDF_PATH}/components/bt/bluedroid/osi/include
$ENV{IDF_PATH}/components/bt/bluedroid/btc/profile/esp/blufi/include
$ENV{IDF_PATH}/components/bt/bluedroid/btc/profile/esp/include
$ENV{IDF_PATH}/components/bt/bluedroid/btc/profile/std/include
$ENV{IDF_PATH}/components/bt/bluedroid/stack/include
$ENV{IDF_PATH}/components/bt/bluedroid/stack/l2cap/include
$ENV{IDF_PATH}/components/bt/bluedroid/stack/sdp/include
$ENV{IDF_PATH}/components/bt/bluedroid/stack/smp/include
$ENV{IDF_PATH}/components/bt/bluedroid/api/include
$ENV{IDF_PATH}/components/bt/bluedroid/btc/include
$ENV{IDF_PATH}/components/mdns/include
$ENV{IDF_PATH}/components/soc/esp32/include
$ENV{IDF_PATH}/components/aws_iot/include
$ENV{IDF_PATH}/components/aws_iot/aws-iot-device-sdk-embedded-C/include
$ENV{IDF_PATH}/components/fatfs/src
$ENV{IDF_PATH}/components/wear_levelling/include )

User avatar
ESP_krzychb
Posts: 400
Joined: Sat Oct 01, 2016 9:05 am
Contact:

Re: ESP32 Unresolved Inclusion on Hello World

Postby ESP_krzychb » Thu Jan 02, 2020 1:41 pm

mylenedipenta wrote:
Tue Dec 31, 2019 9:53 pm
Thanks. While I was working on a separate problem, I modified the file CMakeList (to add versioning) and when I rebuilt the project (which forced cmake to recreate the makefile), the #include statements resolved. The problem has not recurred, in this or other projects. Not sure if it's related or not, but it's working for now.
Hi @mylenedipenta,

Do you still use Eclipse 4.10.0? Could you also confirm the plugin release?

I am asking since I believe this issue shows up for the following s/w combination:

OS: Windows 10
Eclipse: 2019-12 (4.14.0)
Plugin: idf-eclipse-plugin-v1.0.0-beta.4

Apparently the issue does not show up for earlier version of Eclipse and the plugin, but I was not able to check it myself. On the other hand I do not see this issue when when running the latest Eclipse and plugin on Linux.

MJ48574
Posts: 6
Joined: Sun Dec 29, 2019 8:17 am

Re: ESP32 Unresolved Inclusion on Hello World

Postby MJ48574 » Thu Jan 02, 2020 3:41 pm

I am indeed running Windows 10 and eclipse 2019-12(4.14.0) and following Espressif IDF Plugins.
Espressif IDF Plugins for Eclipse 1.0.0.201912090756 com.espressif.idf.feature.feature.group ESPRESSIF SYSTEMS (SHANGHAI) CO., LTD.

I guess I need to uninstall Eclipse and Install eclipse 2019-09.

I will let you know the result.
Thanks

MJ48574
Posts: 6
Joined: Sun Dec 29, 2019 8:17 am

Re: ESP32 Unresolved Inclusion on Hello World

Postby MJ48574 » Fri Jan 03, 2020 8:40 pm

I ended up breaking the installation.
Decided to remove everything and reinstall from scratch.
This time installed ESP32 IDF 4.0 release with Eclipse 2019-12 on Windows 10. Unresolved inclusions still exist.
Installed Eclipse 2019-09 and Unresolved Inclusions are gone.
Thanks for your help.

Who is online

Users browsing this forum: No registered users and 21 guests