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' */
main.cpp@0:6cdfc5265dfe, 2014-10-05 (annotated)
- Committer:
- sbts
- Date:
- Sun Oct 05 11:54:37 2014 +0000
- Revision:
- 0:6cdfc5265dfe
Sample Code that works for online compiler but doesn't work for GCC ARM
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sbts | 0:6cdfc5265dfe | 1 | #include "mbed.h" |
sbts | 0:6cdfc5265dfe | 2 | #include "USBSerial.h" |
sbts | 0:6cdfc5265dfe | 3 | |
sbts | 0:6cdfc5265dfe | 4 | DigitalOut myled(LED1); |
sbts | 0:6cdfc5265dfe | 5 | |
sbts | 0:6cdfc5265dfe | 6 | //Virtual serial port over USB |
sbts | 0:6cdfc5265dfe | 7 | USBSerial serial; |
sbts | 0:6cdfc5265dfe | 8 | |
sbts | 0:6cdfc5265dfe | 9 | int i=0; |
sbts | 0:6cdfc5265dfe | 10 | int main() { |
sbts | 0:6cdfc5265dfe | 11 | while(1) { |
sbts | 0:6cdfc5265dfe | 12 | serial.printf("I am a virtual serial port %u \r", i++); |
sbts | 0:6cdfc5265dfe | 13 | serial.write("asdf"); |
sbts | 0:6cdfc5265dfe | 14 | FileHandle::write("asdf") |
sbts | 0:6cdfc5265dfe | 15 | myled = 1; |
sbts | 0:6cdfc5265dfe | 16 | wait(0.2); |
sbts | 0:6cdfc5265dfe | 17 | myled = 0; |
sbts | 0:6cdfc5265dfe | 18 | wait(0.2); |
sbts | 0:6cdfc5265dfe | 19 | } |
sbts | 0:6cdfc5265dfe | 20 | } |
sbts | 0:6cdfc5265dfe | 21 | |
sbts | 0:6cdfc5265dfe | 22 | //when compiled with GCC_ARM we get the following issues which result in unresolved symbols |
sbts | 0:6cdfc5265dfe | 23 | /* |
sbts | 0:6cdfc5265dfe | 24 | - The type 'USBSerial' must implement the inherited pure virtual method |
sbts | 0:6cdfc5265dfe | 25 | 'mbed::FileHandle::write' |
sbts | 0:6cdfc5265dfe | 26 | - The type 'USBSerial' must implement the inherited pure virtual method |
sbts | 0:6cdfc5265dfe | 27 | 'mbed::FileHandle::lseek' |
sbts | 0:6cdfc5265dfe | 28 | - The type 'USBSerial' must implement the inherited pure virtual method |
sbts | 0:6cdfc5265dfe | 29 | 'mbed::FileHandle::read' |
sbts | 0:6cdfc5265dfe | 30 | */ |