I'm trying to take an example code from ESP IDF (https_advanced_ota) and put it inside a folder called "ota" so that it's not in the root and keep it tidy.
This creates a problem with the includes and declarations. I updated the cmakelists.txt files accordingly which was a bit of a nightmare to understand how they work. I think I managed to do most correctly, but I still get an error of a file not included, although I explicitly tell the compiler where the file is by providing the path in the #include statement and the c_cpp_properties.json
Can someone take a look and help me find the problem? I'm obviously missing something here.
VS code ESP IDF components issue
VS code ESP IDF components issue
- Attachments
-
- folders.zip
- (31.38 KiB) Downloaded 582 times
-
- 2.jpg (185.36 KiB) Viewed 3557 times
-
- 1.jpg (233.12 KiB) Viewed 3557 times
-
- Posts: 9739
- Joined: Thu Nov 26, 2015 4:08 am
Re: VS code ESP IDF components issue
Yeah, don't use absolute paths like that, you should be able to simply #include "freertos/FreeRTOS.h". Your issue is that your component doesn't state it needs FreeRTOS so the build system doesn't include it in its include path. See here, but tl;dr is that you need to add a 'REQUIRES freertos' in your CMakeLists.txt.
Re: VS code ESP IDF components issue
Thanks a lot ESP_Sprite ! Really saved my day
I had been struggling to understand how these declarations (includes) of files work. The examples in ESP IDF documentation are very basic. I think I get it now so I can keep my code files tidy.I get some variables issues but I think I can sort them out.
I had been struggling to understand how these declarations (includes) of files work. The examples in ESP IDF documentation are very basic. I think I get it now so I can keep my code files tidy.I get some variables issues but I think I can sort them out.
Re: VS code ESP IDF components issue
The build stops but I see no errors. If I open a few files VScode finally start to show the errors (2nd pic).
The error seems to be socket.h missing but actually a variable inside it says is undefined.
I also have a question.
How do I find which components I need to include in the cmakelists.txt files in my case for the https_advanced_ota example ?
The error seems to be socket.h missing but actually a variable inside it says is undefined.
I also have a question.
How do I find which components I need to include in the cmakelists.txt files in my case for the https_advanced_ota example ?
Re: VS code ESP IDF components issue
The red squiggles are courtesy of Intellisense, not the build process. Ideally the errors from both would be the same, but as you can see if there's any issue with the Intellisense configuration then you can get these annoying red herrings.
The build output contains your actual error. In this case, it's from the linker:
The build output contains your actual error. In this case, it's from the linker:
Check the relevant CMakeLists.txt for EMBED_TXTFILES or EMBED_FILES containing the path to this file (ca_cert.pem), and that the file exists.undefined reference to `_binary_ca_cert_pem_start`
When you're developing the component you can add dependencies as you use them. Or you can look through the 'include's in the component's source files which usually give a pretty good hint of what you need. But the easiest of all is probably to brute force it: keep trying to build, adding dependencies every time you get an undefined reference error in that component, until it builds successfully.How do I find which components I need to include in the cmakelists.txt
Re: VS code ESP IDF components issue
Bullseye ! Thanks a lot boarchuz
I hadn't even noticed the `_binary_ca_cert_pem_start` part in the build output. I had to include that line you posted.
Intellisense has issues.
I hadn't even noticed the `_binary_ca_cert_pem_start` part in the build output. I had to include that line you posted.
Intellisense has issues.
Who is online
Users browsing this forum: No registered users and 99 guests