Trying to expand this project with a simple additional function - make a HTTP GET call.
- I have downloaded this HTTP client and put it in the compoenents folder
- I made sure the
CMakeLists.txtfile exists with the following content
FILE(GLOB_RECURSE app_sources "./src/*.c")
idf_component_register(
SRCS ${app_sources}
INCLUDE_DIRS "./include"
REQUIRES esp_http_client esp-tls json
)
- I then proceed to add
#include <http_rest_client.h>in one of the apps, specifically inmain\apps\app_temp_demo\gui\gui_temp_demo.cpp - Added a function that perform the call as per example(s) in the library repo
void sendrequest()
{
http_rest_recv_buffer_t response_buffer = {0};
// do the request
ESP_ERROR_CHECK(http_rest_client_get("https://catoftheday.com/", &response_buffer));
char buffer[50]; // Buffer to hold the resulting string
int status_code = response_buffer.status_code; // Your status code
sprintf(buffer, "Status Code %d", status_code); // Write to buffer
// print response status
// sprintf("Status Code %d", response_buffer.status_code);
// do something with the data
printf("%s", response_buffer.buffer);
// clean up
http_rest_client_cleanup(&response_buffer);
}
Up to this point building the project (idf.py build) is a success, unfortunately once I add a call to hte sendrequest function I get the following warnings/errors:
It feels like the library isnt picked up and built. Any suggestion on what I might be missing or potentially a better approach i.e. differnt library, etc?

Going out on a limb here after scanning the projects you are referencing, but I think you are missing the
extern Chence your want to use aClibrary in aC++project.Adding something like
should help. Alternatively you could adapt the header files of the referenced component.