how to update build copy of IDF files?

User avatar
mzimmers
Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

how to update build copy of IDF files?

Postby mzimmers » Mon Aug 12, 2019 6:38 pm

Hi all -

I've been asked to add an HTTP server to our application. My build directory in my application seems to be missing some files that are present in the IDF. I'm not sure what happened, but can someone remind me how to update the copy of the IDF components I have in my build directory?

Thanks...

EDIT: I tried deleting the "build" subdirectory from my project, and running make again. The subdirectory regenerated, but I still had files that were different from what I was expecting. What am I doing wrong?
Image
Image
Attachments
project.PNG
project.PNG (7.91 KiB) Viewed 3675 times
idf.PNG
idf.PNG (10.11 KiB) Viewed 3675 times

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

Re: how to update build copy of IDF files?

Postby ESP_Angus » Tue Aug 13, 2019 5:35 am

Hi mzimmers,

Not sure I fully understand your question, sorry. The "build" directory contains build output from the build system and compiler while building the project. Source files are generally not copied from the IDF_PATH directory to the build directory, instead the source files are compiled into object files and libraries in the build directory.

Does that shed some light? If not, can you please explain in detail exactly which files you expect to see in the build directory which aren't there?

User avatar
mzimmers
Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: how to update build copy of IDF files?

Postby mzimmers » Tue Aug 13, 2019 1:56 pm

Hi Angus -

I'd forgotten that the build directory doesn't contain source files. The file I want to use is esp_http_server.h from esp_http_server/include. I notice that it's not in $IDF_PATH/components/esp32/include. It's been so long since I added a component to my programs that I don't remember how to do it. Do I just copy the header file to this directory?

Thanks...

EDIT: I did a bit more snooping, to try to knock the rust off my memory. I guess somehow, make magically finds all the include files in the IDF. So, I removed the pathname portion of my #include directive and it found the file. I'm still not sure I know how it does this, but it builds.

On a side note, I use Qt Creator as my code editor and browser, and a code model enforcer. It couldn't find the enums for HTTP_GET, HTTP_POST, etc. so I went looking for them, and I couldn't find them anywhere either, but...the build succeeds. Where are these defined?

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

Re: how to update build copy of IDF files?

Postby ESP_Angus » Wed Aug 14, 2019 1:29 am

mzimmers wrote:
Tue Aug 13, 2019 1:56 pm
EDIT: I did a bit more snooping, to try to knock the rust off my memory. I guess somehow, make magically finds all the include files in the IDF. So, I removed the pathname portion of my #include directive and it found the file. I'm still not sure I know how it does this, but it builds.
The ESP-IDF build system automatically adds all of the include paths for used components when it runs the compiler.

If you're using CMake, note that components in CMake need to declare which other components they depend on - otherwise the paths for these components won't be passed to the compiler.
mzimmers wrote:
Tue Aug 13, 2019 1:56 pm
On a side note, I use Qt Creator as my code editor and browser, and a code model enforcer. It couldn't find the enums for HTTP_GET, HTTP_POST, etc. so I went looking for them, and I couldn't find them anywhere either, but...the build succeeds. Where are these defined?
Defined here:
https://github.com/espressif/esp-idf/bl ... rser.h#L98

As you can see, the header uses some C preprocessor magic to generate the full HTTP_POST symbol name. If Qt Creator is not running the header files through the preprocessor, it won't be able to recognize the symbol name.

Who is online

Users browsing this forum: doragasu, ferrero, forrest and 141 guests