Sample USBserial project that compiles OK on Web Compiler, but breaks for GCC ARM
This code compiles on the online MBED compiler.
When Exported to GCC ARM it fails.
//when compiled with GCC_ARM we get the following issues which result in unresolved symbols /* - The type 'USBSerial' must implement the inherited pure virtual method 'mbed::FileHandle::write' - The type 'USBSerial' must implement the inherited pure virtual method 'mbed::FileHandle::lseek' - The type 'USBSerial' must implement the inherited pure virtual method 'mbed::FileHandle::read' */
Diff: main.cpp
- Revision:
- 0:6cdfc5265dfe
diff -r 000000000000 -r 6cdfc5265dfe main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Oct 05 11:54:37 2014 +0000 @@ -0,0 +1,30 @@ +#include "mbed.h" +#include "USBSerial.h" + +DigitalOut myled(LED1); + +//Virtual serial port over USB +USBSerial serial; + +int i=0; +int main() { + while(1) { + serial.printf("I am a virtual serial port %u \r", i++); + serial.write("asdf"); + FileHandle::write("asdf") + myled = 1; + wait(0.2); + myled = 0; + wait(0.2); + } +} + +//when compiled with GCC_ARM we get the following issues which result in unresolved symbols +/* + - The type 'USBSerial' must implement the inherited pure virtual method + 'mbed::FileHandle::write' + - The type 'USBSerial' must implement the inherited pure virtual method + 'mbed::FileHandle::lseek' + - The type 'USBSerial' must implement the inherited pure virtual method + 'mbed::FileHandle::read' +*/ \ No newline at end of file