Compile errors when creating multiple cpp files
Posted: Tue May 21, 2024 2:44 am
I know I am doing something stupid here but I can't figure out what. Basically I have IDF 5.1.3 and ESP Zigbee in a project. When I had it all in 1 .c and 1 .h file I could compile everything without any issues and it worked. However as the project has grown in size I have moved the functions etc to different files to make it simpler to follow. But now when I compile (I am doing inside ESP-IDF Powershell) I get random errors that I wasn't getting before. As an example, I get this error:
But if I go to main.cpp, where this error comes from, it is the exact same code from the project that compiles correctly (i.e. the single file project)
Doesn't compile:
Does compile:
when I follow the uint32_t definition in the project that doesn't compile it is picking up a define from esp_wifi_crypto_types.h
but I haven't added this .h file. In the project that does compile is isn't picking up this define. I don't believe that I have added any additional .h files that should be causing this.
Have I stuffed up somewhere and it is bringing in additional header files that is causing these compile issues?
Code: Select all
error: invalid conversion from 'uint32_t' {aka 'long unsigned int'} to 'esp_zb_app_signal_type_t' [-fpermissive] 353 | esp_zb_app_signal_type_t sig_type = *p_sg_p;
Doesn't compile:
Code: Select all
void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct)
{
uint32_t *p_sg_p = signal_struct->p_app_signal;
esp_err_t err_status = signal_struct->esp_err_status;
esp_zb_app_signal_type_t sig_type = *p_sg_p;
esp_zb_zdo_signal_device_annce_params_t *dev_annce_params = NULL;
Code: Select all
void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct)
{
uint32_t *p_sg_p = signal_struct->p_app_signal;
esp_err_t err_status = signal_struct->esp_err_status;
esp_zb_app_signal_type_t sig_type = *p_sg_p;
esp_zb_zdo_signal_device_annce_params_t *dev_annce_params = NULL;
Code: Select all
typedef uint32_t (*esp_crc32_le_t)(uint32_t crc, uint8_t const *buf, uint32_t len);
Have I stuffed up somewhere and it is bringing in additional header files that is causing these compile issues?