Fail to link component

User avatar
urbanze
Posts: 270
Joined: Sat Jun 10, 2017 9:55 pm
Location: Brazil

Fail to link component

Postby urbanze » Fri Oct 16, 2020 12:09 pm

Hello guys! I trying to add new component (PPPoS library of IDF example) in a big C++ project, however, many errors appears. Using IDF v4.0-dev-76-g96aa08a0f.

I already test this library in separate project folder with main.cpp and worked, but in my big project never compile.

esp32-pppos folder contains ->

Code: Select all

component.mk
CMakeList.txt
include/ (.h files)
src/ (.c files)

component.mk contains ->

Code: Select all

COMPONENT_ADD_INCLUDEDIRS := include
COMPONENT_SRCDIRS := src
CMakeList.txt contains ->

Code: Select all

set(COMPONENT_ADD_INCLUDEDIRS .)

set(COMPONENT_SRCS  "src/esp_modem.c"
                    "src/esp_modem_dce_service.c"
                    "src/sim800.c"
                    "src/esp32-pppos.c")

set(COMPONENT_ADD_INCLUDEDIRS "include")

set(COMPONENT_REQUIRES driver)

register_component()

If I change the main.c to main.cpp in "PPPoS_client example present on IDF", this work fine. But in my separate code, this erros appears.


Code: Select all

/home/jose/esp/project/components/esp32-pppos/esp_modem.c:77:18: error: field 'pppif' has incomplete type
     struct netif pppif;                     /*!< PPP network interface */
                  ^
/home/jose/esp/project/components/esp32-pppos/esp_modem.c:78:5: error: unknown type name 'ppp_pcb'
     ppp_pcb *ppp;                           /*!< PPP control block */
     ^
/home/jose/esp/project/components/esp32-pppos/esp_modem.c: In function 'esp_handle_uart_data':
/home/jose/esp/project/components/esp32-pppos/esp_modem.c:154:9: error: implicit declaration of function 'pppos_input_tcpip' [-Werror=implicit-function-declaration]
         pppos_input_tcpip(esp_dte->ppp, esp_dte->buffer, length);
         ^
/home/jose/esp/project/components/esp32-pppos/esp_modem.c: At top level:
/home/jose/esp/project/components/esp32-pppos/esp_modem.c:468:35: error: unknown type name 'ppp_pcb'
 static void on_ppp_status_changed(ppp_pcb *pcb, int err_code, void *ctx)
                                   ^
/home/jose/esp/project/components/esp32-pppos/esp_modem.c:578: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)
                                        ^
/home/jose/esp/project/components/esp32-pppos/esp_modem.c: In function 'esp_modem_setup_ppp':
/home/jose/esp/project/components/esp32-pppos/esp_modem.c:594: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);
                    ^
/home/jose/esp/project/components/esp32-pppos/esp_modem.c:594:59: error: 'pppos_low_level_output' undeclared (first use in this function)
     esp_dte->ppp = pppapi_pppos_create(&(esp_dte->pppif), pppos_low_level_output, on_ppp_status_changed, dte);
                                                           ^
/home/jose/esp/project/components/esp32-pppos/esp_modem.c:594:59: note: each undeclared identifier is reported only once for each function it appears in
/home/jose/esp/project/components/esp32-pppos/esp_modem.c:594: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);
                                                                                   ^
/home/jose/esp/project/components/esp32-pppos/esp_modem.c:601: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);
                 ^
/home/jose/esp/project/components/esp32-pppos/esp_modem.c:57:15: note: in definition of macro 'MODEM_CHECK'
         if (!(a))                                                                       \
               ^
/home/jose/esp/project/components/esp32-pppos/esp_modem.c:603:5: error: implicit declaration of function 'ppp_set_usepeerdns' [-Werror=implicit-function-declaration]
     ppp_set_usepeerdns(esp_dte->ppp, 1);
     ^
/home/jose/esp/project/components/esp32-pppos/esp_modem.c:610:2: error: #error "Unsupported AUTH Negotiation"
 #error "Unsupported AUTH Negotiation"
  ^
/home/jose/esp/project/components/esp32-pppos/esp_modem.c:613: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);
                 ^
/home/jose/esp/project/components/esp32-pppos/esp_modem.c:57:15: note: in definition of macro 'MODEM_CHECK'
         if (!(a))                                                                       \
               ^
/home/jose/esp/project/components/esp32-pppos/esp_modem.c: In function 'esp_modem_exit_ppp':
/home/jose/esp/project/components/esp32-pppos/esp_modem.c:626:17: error: implicit declaration of function 'pppapi_close' [-Werror=implicit-function-declaration]
     MODEM_CHECK(pppapi_close(esp_dte->ppp, 0) == ERR_OK, "close ppp connection failed", err);
                 ^
/home/jose/esp/project/components/esp32-pppos/esp_modem.c:57:15: note: in definition of macro 'MODEM_CHECK'
         if (!(a))                                                                       \
               ^

User avatar
urbanze
Posts: 270
Joined: Sat Jun 10, 2017 9:55 pm
Location: Brazil

Re: Fail to link component

Postby urbanze » Sun Oct 18, 2020 12:08 pm

Anyone? I really need help with this!

User avatar
urbanze
Posts: 270
Joined: Sat Jun 10, 2017 9:55 pm
Location: Brazil

Re: Fail to link component

Postby urbanze » Tue Oct 20, 2020 11:31 am

Solved! I enabled the PPP support in LwIP menuconfig.

Who is online

Users browsing this forum: No registered users and 28 guests