esp32-snippets BLE build problem

pdxalz
Posts: 2
Joined: Sat Mar 12, 2016 6:47 pm

esp32-snippets BLE build problem

Postby pdxalz » Wed Sep 20, 2017 8:44 pm

I'm trying to build one of the Kolban's BLE examples, but have hit a build issue I can't figure out. I'm using eclipse and getting:
"fatal error: esp_gattc_api.h: No such file or directory"
I get the same error if I run make from a terminal.

I've successfully built the cpp3 c++ app, I've used menuconfig to enable bluetooth and bluedroid. I created a components folder with the snippets files. I checked project properties paths and symbols and I have an entry for: ${IDF_PATH}/components/bt/bluedroid/api/include which is where the file is. I checked the folder and the file is there.

Exploring further, I deleted the components folder with the snippets stuff and put "#include <esp_gattc_api.h>" into helloworld_main.cpp and I get the same error. Also it appears that trying to include any .h under bluedroid will fail, but "bt.h" in bt/include compiles fine.

Alan

vibnwis
Posts: 89
Joined: Thu Aug 24, 2017 1:13 am

Re: esp32-snippets BLE build problem

Postby vibnwis » Thu Sep 21, 2017 10:57 pm

In cases like this, it is wise to use full path the header file, assuming you have found where that file is. Once you have sorted out the issues, place the header the right folder and then add the path onto Eclipse's "symbols and include path" tab.

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: esp32-snippets BLE build problem

Postby kolban » Fri Sep 22, 2017 3:08 am

This video may also help:

https://www.youtube.com/watch?v=-ttiPfmrehU

If problems persist, feel free to create an issue on the Github issues page found here:

https://github.com/nkolban/esp32-snippets/issues

However I think you were probably right posting here ... as I suspect that the puzzle is ESP32 generic and could be re-phrase to:
How do I specify directories for include files in a C++ environment when writing ESP-IDF applications?
The thinking here is that the missing include file in the compilation is an ESP-IDF supplied header. Again, if the problem persists, I'll be happy to work with you directly to try and assist. What we'd want to see are:

1. The source of the file trying to perform the inclusion.
2. The directory structure of your ESP-IDF environment.
3. Exactly how you are attempting to build the app.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

pdxalz
Posts: 2
Joined: Sat Mar 12, 2016 6:47 pm

Re: esp32-snippets BLE build problem

Postby pdxalz » Fri Sep 22, 2017 5:10 pm

Thanks for both replies. I had watched the "Building a C++ application" video you sent a link to, and that part of it went fairly well. My problems started when I created a new components folder and added in the esp32-snippets. I managed to import the includes and rebuild the index. But I was still getting the unresolved inclusion errors. The file existed and it's folder was listed in the includes.

I did finally get it to build. I'm not %100 sure, but it seemed like things started working after a project clean.

I think there is something about Eclipse that I'm not understanding. I feel like I spend most of my time trying to understand the tool instead of understanding the code.

Who is online

Users browsing this forum: No registered users and 89 guests