I have been trying to build the Asynch-serial communication example provided in
But, the build fails due to linker issues. The linker is unable to find the definitions for the function
undefined reference to mbed::SerialBase::read undefined reference to mbed::SerialBase::write
In Serial.h file the methods are hidden as using the DEVICE_SERIAL_ASYNCH preprocessor
#if DEVICE_SERIAL_ASYNCH
using SerialBase::read;
using SerialBase::write; #endif
In order to invoke these function in serial_async.cpp, I define as below #define DEVICE_SERIAL_ASYNCH 1
before adding the includes. But, this is of no help and still the linker is unable to find the two methods.
undefined reference to mbed::SerialBase::read undefined reference to mbed::SerialBase::write
Can someone let me know if I am missing something?
Which target are you building for? (You can use the yotta target command to display this, or it’ll also be included at the start of the output that yotta build displays)
Also note that you can put triple back-ticks around code to format it correctly in the forum: