Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

"error: #114: function "gatt_init" was referenced but not defined", but defined indeed

I just move code from main.c to other files for it is too chaos to lay them together in main.c.

I got this error forever after trying what I can image,except delete "static".

Knowledge is time Slight smile

#114: function “xxx“ was referenced but not defined-CSDN博客

"static" limited target can only used inner in that file.

By the way, Nordic can advise me on how to refer to the type name created in macro:

m_app_cdc_acm_t created by this macro:

APP_USBD_CDC_ACM_GLOBAL_DEF(m_app_cdc_acm,
                            cdc_acm_user_ev_handler,
                            CDC_ACM_COMM_INTERFACE,
                            CDC_ACM_DATA_INTERFACE,
                            CDC_ACM_COMM_EPIN,
                            CDC_ACM_DATA_EPIN,
                            CDC_ACM_DATA_EPOUT,
                            APP_USBD_CDC_COMM_PROTOCOL_AT_V250
);

Is there a safe way to refer the type (m_app_cdc_acm_t)?

I have to refer them with hardcode in other files:

extern app_usbd_cdc_acm_t m_app_cdc_acm;

That is not a good way obviously.

Thank you.

Related