Page 1 of 1

undefined reference to `port_clear_status(EVENT_GROUP_SELECT_T, unsigned long)'

Posted: Fri Sep 06, 2024 1:59 am
by greenstone
Why does a simple project compile successfully by changing the source file A.cpp of custom component A to A.c, otherwise there will be a link error for undefined reference to "port_det_stat() - (in custom component B)"

Re: undefined reference to `port_clear_status(EVENT_GROUP_SELECT_T, unsigned long)'

Posted: Fri Sep 06, 2024 3:39 am
by MicroController
Is port_det_stat() declared as extern "C" when used from C++? (cf. https://embeddedartistry.com/blog/2017/ ... -extern-c/)

Re: undefined reference to `port_clear_status(EVENT_GROUP_SELECT_T, unsigned long)'

Posted: Fri Sep 06, 2024 7:58 am
by greenstone
MicroController wrote:
Fri Sep 06, 2024 3:39 am
Is port_det_stat() declared as extern "C" when used from C++? (cf. https://embeddedartistry.com/blog/2017/ ... -extern-c/)
yes,the .h header file include "extren "C"