espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.31k stars 7.2k forks source link

PPPoS component compiling error (IDFGH-1903) #4104

Closed memristor2 closed 4 years ago

memristor2 commented 4 years ago

Environment

Problem Description

Hi, I want to use the pppos example for another project. When I add the components to my own project directory it seems it doesn't find the right header files for the components and it ends up with an error. If I compile the example itself in esp-idf repo there's no problem. I'm using Cmake but I had the same problem with the legacy GNU make. I've also tried reinstalling the whole esp-idf repo but it didn't work


[3/14] Building C object esp-idf/modem/CMakeFiles/__idf_modem.dir/src/esp_modem.c.obj
FAILED: esp-idf/modem/CMakeFiles/__idf_modem.dir/src/esp_modem.c.obj 
/home/user/.espressif/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc  -Iconfig -I../components/modem/include -I/home/user/esp/esp-idf/components/newlib/platform_include -I/home/user/esp/esp-idf/components/freertos/include -I/home/user/esp/esp-idf/components/heap/include -I/home/alireza/esp/esp-idf/components/log/include -I/home/alireza/esp/esp-idf/components/soc/esp32/include -I/home/alireza/esp/esp-idf/components/soc/include -I/home/alireza/esp/esp-idf/components/esp_rom/include -I/home/alireza/esp/esp-idf/components/esp_common/include -I/home/alireza/esp/esp-idf/components/xtensa/include -I/home/alireza/esp/esp-idf/components/xtensa/esp32/include -I/home/alireza/esp/esp-idf/components/esp32/include -I/home/alireza/esp/esp-idf/components/driver/include -I/home/alireza/esp/esp-idf/components/esp_ringbuf/include -I/home/alireza/esp/esp-idf/components/esp_event/include -I/home/alireza/esp/esp-idf/components/tcpip_adapter/include -I/home/alireza/esp/esp-idf/components/lwip/include/apps -I/home/alireza/esp/esp-idf/components/lwip/include/apps/sntp -I/home/alireza/esp/esp-idf/components/lwip/lwip/src/include -I/home/alireza/esp/esp-idf/components/lwip/port/esp32/include -I/home/alireza/esp/esp-idf/components/lwip/port/esp32/include/arch -I/home/alireza/esp/esp-idf/components/vfs/include -I/home/alireza/esp/esp-idf/components/esp_wifi/include -I/home/alireza/esp/esp-idf/components/esp_wifi/esp32/include -I/home/alireza/esp/esp-idf/components/esp_eth/include -I/home/alireza/esp/esp-idf/components/efuse/include -I/home/alireza/esp/esp-idf/components/efuse/esp32/include -I/home/alireza/esp/esp-idf/components/app_trace/include -mlongcalls -Wno-frame-address   -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -nostdlib -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -ggdb -Og -std=gnu99 -Wno-old-style-declaration -D_GNU_SOURCE -DIDF_VER=\"v4.1-dev-281-g96b96ae24\" -DGCC_NOT_5_2_0 -DESP_PLATFORM -MD -MT esp-idf/modem/CMakeFiles/__idf_modem.dir/src/esp_modem.c.obj -MF esp-idf/modem/CMakeFiles/__idf_modem.dir/src/esp_modem.c.obj.d -o esp-idf/modem/CMakeFiles/__idf_modem.dir/src/esp_modem.c.obj   -c ../components/modem/src/esp_modem.c
../components/modem/src/esp_modem.c:63:18: error: field 'pppif' has incomplete type
     struct netif pppif;                     /*!< PPP network interface */
                  ^~~~~
../components/modem/src/esp_modem.c:64:5: error: unknown type name 'ppp_pcb'
     ppp_pcb *ppp;                           /*!< PPP control block */
     ^~~~~~~
../components/modem/src/esp_modem.c: In function 'esp_handle_uart_data':
../components/modem/src/esp_modem.c:140:9: error: implicit declaration of function 'pppos_input_tcpip' [-Werror=implicit-function-declaration]
         pppos_input_tcpip(esp_dte->ppp, esp_dte->buffer, length);
         ^~~~~~~~~~~~~~~~~
../components/modem/src/esp_modem.c: At top level:
../components/modem/src/esp_modem.c:454:35: error: unknown type name 'ppp_pcb'
 static void on_ppp_status_changed(ppp_pcb *pcb, int err_code, void *ctx)
                                   ^~~~~~~
../components/modem/src/esp_modem.c:571:40: error: unknown type name 'ppp_pcb'
 static uint32_t pppos_low_level_output(ppp_pcb *pcb, uint8_t *data, uint32_t len, void *ctx)
                                        ^~~~~~~
../components/modem/src/esp_modem.c: In function 'esp_modem_setup_ppp':
../components/modem/src/esp_modem.c:587:20: error: implicit declaration of function 'pppapi_pppos_create' [-Werror=implicit-function-declaration]
     esp_dte->ppp = pppapi_pppos_create(&(esp_dte->pppif), pppos_low_level_output, on_ppp_status_changed, dte);
                    ^~~~~~~~~~~~~~~~~~~
../components/modem/src/esp_modem.c:587:59: error: 'pppos_low_level_output' undeclared (first use in this function); did you mean 'esp_log_level_set'?
     esp_dte->ppp = pppapi_pppos_create(&(esp_dte->pppif), pppos_low_level_output, on_ppp_status_changed, dte);
                                                           ^~~~~~~~~~~~~~~~~~~~~~
                                                           esp_log_level_set
../components/modem/src/esp_modem.c:587:59: note: each undeclared identifier is reported only once for each function it appears in
../components/modem/src/esp_modem.c:587:83: error: 'on_ppp_status_changed' undeclared (first use in this function)
     esp_dte->ppp = pppapi_pppos_create(&(esp_dte->pppif), pppos_low_level_output, on_ppp_status_changed, dte);
                                                                                   ^~~~~~~~~~~~~~~~~~~~~
../components/modem/src/esp_modem.c:594:17: error: implicit declaration of function 'pppapi_set_default' [-Werror=implicit-function-declaration]
     MODEM_CHECK(pppapi_set_default(esp_dte->ppp) == ERR_OK, "set default route failed", err);
                 ^~~~~~~~~~~~~~~~~~
../components/modem/src/esp_modem.c:43:15: note: in definition of macro 'MODEM_CHECK'
         if (!(a))                                                                       \
               ^
../components/modem/src/esp_modem.c:596:5: error: implicit declaration of function 'ppp_set_usepeerdns' [-Werror=implicit-function-declaration]
     ppp_set_usepeerdns(esp_dte->ppp, 1);
     ^~~~~~~~~~~~~~~~~~
../components/modem/src/esp_modem.c:603:2: error: #error "Unsupported AUTH Negotiation"
 #error "Unsupported AUTH Negotiation"
  ^~~~~
../components/modem/src/esp_modem.c:606:17: error: implicit declaration of function 'pppapi_connect' [-Werror=implicit-function-declaration]
     MODEM_CHECK(pppapi_connect(esp_dte->ppp, 0) == ERR_OK, "initiate ppp negotiation failed", err);
                 ^~~~~~~~~~~~~~
../components/modem/src/esp_modem.c:43:15: note: in definition of macro 'MODEM_CHECK'
         if (!(a))                                                                       \
               ^
../components/modem/src/esp_modem.c: In function 'esp_modem_exit_ppp':
../components/modem/src/esp_modem.c:619:17: error: implicit declaration of function 'pppapi_close'; did you mean 'pclose'? [-Werror=implicit-function-declaration]
     MODEM_CHECK(pppapi_close(esp_dte->ppp, 0) == ERR_OK, "close ppp connection failed", err);
                 ^~~~~~~~~~~~
../components/modem/src/esp_modem.c:43:15: note: in definition of macro 'MODEM_CHECK'
         if (!(a))                                                                       \
               ^
cc1: some warnings being treated as errors
[5/14] Building C object esp-idf/main/CMakeFiles/__idf_main.dir/fpi.c.obj
In file included from ../main/fpi.c:7:
/home/alireza/esp/esp-idf/components/esp_event/include/esp_event_loop.h:2:2: warning: #warning "esp_event_loop.h is deprecated, please include esp_event.h instead" [-Wcpp]
 #warning "esp_event_loop.h is deprecated, please include esp_event.h instead"
  ^~~~~~~
[8/14] Building C object esp-idf/modem/CMakeFiles/__idf_modem.dir/src/sim800.c.obj
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
memristor2 commented 4 years ago

I solved the problem by finding out that all I had to do was to enable PPP support and authentication methods in the lwip component in menuconfig