donny681 / ESP32_CAMERA_QR

Apache License 2.0
628 stars 226 forks source link

compilation error #40

Open poaongithub opened 4 years ago

poaongithub commented 4 years ago

hi, @donny681, I got compilation error after clone your code and install "idf.py", how to solve it? Any help appreciated, thanks in advance.

/home/bo/ESP32_CAMERA_QR/main/app_main.c:54:8: error: unknown type name 'esp_ip4_addr_t' static esp_ip4_addr_t s_ip_addr; ^~~~~~ In file included from /home/bo/projects/esp/esp-idf/components/lwip/lwip/src/include/lwip/ip_addr.h:43, from /home/bo/projects/esp/esp-idf/components/tcpip_adapter/include/tcpip_adapter.h:24, from /home/bo/projects/esp/esp-idf/components/esp_event/include/esp_event_legacy.h:22, from /home/bo/projects/esp/esp-idf/components/esp_event/include/esp_event.h:26, from /home/bo/projects/esp/esp-idf/components/esp_wifi/include/esp_wifi.h:64, from /home/bo/ESP32_CAMERA_QR/main/app_main.c:27: /home/bo/ESP32_CAMERA_QR/main/app_main.c: In function 'app_main': /home/bo/projects/esp/esp-idf/components/lwip/lwip/src/include/lwip/ip4_addr.h:176:65: error: request for member 'addr' in something not a structure or union

define ip4_addr_get_byte(ipaddr, idx) (((const u8_t*)(&(ipaddr)->addr))[idx])

                                                             ^
ArkYk commented 3 years ago

I'm not sure,maybe you can watch follow url. https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/network/tcpip_adapter_migration.html#updating-network-connection-code

shun-dgut commented 3 years ago

main/app_main.c 修改为下面这样应该就可以了 //static esp_ip4_addr_t s_ip_addr;
static ip4_addr_t s_ip_addr;