Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 2 months ago.
Offline gcc compilation gives error 'Serial' does not name a type
- include "mbed.h"
- include "Serial.h"
Serial pc(USBTX, USBRX); int main() { pc.printf("Echoes back to the screen anything you type\n"); while(1) { pc.putc(pc.getc()); } }
THis is my cpp file trying to compile using attached make file /media/uploads/gsanthar/makefile.txt I get similar error for AnlaogIN classes , i guess more
arm-none-eabi-g++ -g -ggdb -Os -Wall -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-delete-null-pointer-checks -fmessage-length=0 -fno-builtin -mthumb -mcpu=cortex-m0 -MMD -MP -DTARGET_KL25Z -DTOOLCHAIN_GCC_ARM -DNDEBUG -MF build/main.d -I. -Iinclude -I./mbed -I./mbed/TARGET_KL25Z -I./mbed/platform -I./mbed/TARGET_KL25Z/TARGET_Freescale/TARGET_KLXX -I./mbed/TARGET_KL25Z/TARGET_Freescale/TARGET_KLXX/TARGET_KL25Z -std=gnu++98 -c src/main.cpp -o build/main.o src/main.cpp:5:1: error: 'Serial' does not name a type Serial pc(USBTX, USBRX); ^ src/main.cpp: In function 'int main()': src/main.cpp:7:5: error: 'pc' was not declared in this scope pc.printf("Echoes back to the screen anything you type\n"); ^ Makefile:191: recipe for target 'build/main.o' failed make: * [build/main.o] Error 1
Please provide solution...