Hello,
Does anyone meet a include file issue witht he last update.
The last sample grom my git pull of this morning does not compile.
bta_api.h: No such file or directory
file is present in
components/bt/bluedroid/bta/include/
thanks
iRobux
include sdk file issue
Re: include sdk file issue
Oooh ... I have just started to compile a project as well and now I am getting:
where previously I used to have clean compiles. Running:
So the file exists. Checked its permissions and content and they seem ok ...
Later ... aha ...
For my problem, I had to enable "Bluetooth" in my "make menuconfig" -> Component config -> Bluetooth. Once understood, the original error isn't that bad ... however I don't think its the last we have heard of it. I'd suggest allowing an application to compile even if the "configuration" component says we haven't enabled bluetooth.
Code: Select all
$ make
CC module_bluetooth.o
/home/kolban/esp32/esptest/apps/workspace/duktape/main/./module_bluetooth.c:3:25: fatal error: esp_bt_main.h: No such file or directory
compilation terminated.
/home/kolban/esp32/esptest/esp-idf/make/component_wrapper.mk:176: recipe for target 'module_bluetooth.o' failed
make[1]: *** [module_bluetooth.o] Error 1
/home/kolban/esp32/esptest/esp-idf/make/project.mk:382: recipe for target 'main-build' failed
make: *** [main-build] Error 2
Code: Select all
$ find . -name "esp_bt_main.h" -print
./components/bt/bluedroid/api/include/esp_bt_main.h
Later ... aha ...
For my problem, I had to enable "Bluetooth" in my "make menuconfig" -> Component config -> Bluetooth. Once understood, the original error isn't that bad ... however I don't think its the last we have heard of it. I'd suggest allowing an application to compile even if the "configuration" component says we haven't enabled bluetooth.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: include sdk file issue
When Bluetooth is disabled we don't want any Bluetooth code to be compiled or linked and that is going to cause an error if you are using it. Why wouldn't we want menuconfig to be the authority?kolban wrote: I'd suggest allowing an application to compile even if the "configuration" component says we haven't enabled bluetooth.
Re: include sdk file issue
Howdy WiFive,
I'm all for "make menuconfig" being the source of configuration truth ... my discomfort comes from how disabled functions are manifested. If I disable a capability and then try and leverage it at compilation time, then in my ideal world we would see a compilation error of the form "Attempt to use <XYZ> function but that function is disabled." and not "Header file <PQR> not found".
Again ... my rambling is purely a data point ... but if the original poster's issue was the same as the one I found myself if, then that points to at least two looking for issues with include files and search paths for compilation.
I'm all for "make menuconfig" being the source of configuration truth ... my discomfort comes from how disabled functions are manifested. If I disable a capability and then try and leverage it at compilation time, then in my ideal world we would see a compilation error of the form "Attempt to use <XYZ> function but that function is disabled." and not "Header file <PQR> not found".
Again ... my rambling is purely a data point ... but if the original poster's issue was the same as the one I found myself if, then that points to at least two looking for issues with include files and search paths for compilation.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: include sdk file issue
Sounds good look forward to your pull request that covers all caseskolban wrote: "Attempt to use <XYZ> function but that function is disabled." and not "Header file <PQR> not found.
Re: include sdk file issue
As a workaround/solution ... when we activate Bluetooth in "make menuconfig", that sets the macro variable "CONFIG_BT_ENABLED". If we wish to conditionally compile code only when bluetooth is enabled we can use code similar to the following:
I don't know about the prudence of this practice as a whole, but it seems to work for my needs.
Code: Select all
#include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED)
#include <esp_bt_main.h>
#include <esp_gap_ble_api.h>
// etc etc etc
#endif // CONFIG_BT_ENABLED
// other code
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
- ESP_krzychb
- Posts: 400
- Joined: Sat Oct 01, 2016 9:05 am
- Contact:
Re: include sdk file issue
I agree - this would be ideal.in my ideal world we would see a compilation error of the form "Attempt to use <XYZ> function but that function is disabled."
In the meantime I think that another takeaway from this case is to watch for sdkconfig.defaults file that developers add to some examples. It provides other than default settings in menuconfig. All BT examples have such file with CONFIG_BT_ENABLED=y.
Re: include sdk file issue
kolban wrote:As a workaround/solution ... when we activate Bluetooth in "make menuconfig", that sets the macro variable "CONFIG_BT_ENABLED". If we wish to conditionally compile code only when bluetooth is enabled we can use code similar to the following:
I don't know about the prudence of this practice as a whole, but it seems to work for my needs.Code: Select all
#include "sdkconfig.h" #if defined(CONFIG_BT_ENABLED) #include <esp_bt_main.h> #include <esp_gap_ble_api.h> // etc etc etc #endif // CONFIG_BT_ENABLED // other code
yeap..
agree, here some things how it was solved:
other things:
https://github.com/espressif/esp-idf/co ... 7787c8b781
https://github.com/espressif/esp-idf/issues/238
or missing / deactivates..
possibles:
https://github.com/espressif/esp-idf/co ... 84577521d0
best wishes
rudi
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
Who is online
Users browsing this forum: abbas1375 and 98 guests