11 years, 4 months ago.

Code Red import won't compile

I cant get the following attached project to build in Code Red 4 or 5. It complains about the following. /media/uploads/advantor/clicker_codered_lpc1768.zip

Description Resource Path Location Type use of enum 'UARTName' without previous declaration PeripheralNames.h /clicker/mbed line 18 C/C++ Problem 'UARTName' has a previous declaration here PeripheralNames.h /clicker/mbed line 18 C/C++ Problem 'PinMode' has a previous declaration here PinNames.h /clicker/mbed line 84 C/C++ Problem use of enum 'ADCName' without previous declaration PeripheralNames.h /clicker/mbed line 26 C/C++ Problem invalid type in declaration before ';' token PeripheralNames.h /clicker/mbed line 18 C/C++ Problem using typedef-name 'PinMode' after 'enum' PinNames.h /clicker/mbed line 85 C/C++ Problem using typedef-name 'UARTName' after 'enum' PeripheralNames.h /clicker/mbed line 19 C/C++ Problem invalid type in declaration before ';' token PinNames.h /clicker/mbed line 84 C/C++ Problem use of enum 'PinMode' without previous declaration PinNames.h /clicker/mbed line 84 C/C++ Problem 'PinName' has a previous declaration here PinNames.h /clicker/mbed line 18 C/C++ Problem using typedef-name 'PinName' after 'enum' PinNames.h /clicker/mbed line 19 C/C++ Problem invalid type in declaration before ';' token PinNames.h /clicker/mbed line 18 C/C++ Problem use of enum 'PinName' without previous declaration PinNames.h /clicker/mbed line 18 C/C++ Problem use of enum 'I2CName' without previous declaration PeripheralNames.h /clicker/mbed line 49 C/C++ Problem 'SPIName' has a previous declaration here PeripheralNames.h /clicker/mbed line 43 C/C++ Problem using typedef-name 'SPIName' after 'enum' PeripheralNames.h /clicker/mbed line 44 C/C++ Problem invalid type in declaration before ';' token PeripheralNames.h /clicker/mbed line 43 C/C++ Problem use of enum 'PWMName' without previous declaration PeripheralNames.h /clicker/mbed line 56 C/C++ Problem 'I2CName' has a previous declaration here PeripheralNames.h /clicker/mbed line 49 C/C++ Problem using typedef-name 'I2CName' after 'enum' PeripheralNames.h /clicker/mbed line 50 C/C++ Problem invalid type in declaration before ';' token PeripheralNames.h /clicker/mbed line 49 C/C++ Problem use of enum 'DACName' without previous declaration PeripheralNames.h /clicker/mbed line 38 C/C++ Problem 'ADCName' has a previous declaration here PeripheralNames.h /clicker/mbed line 26 C/C++ Problem using typedef-name 'ADCName' after 'enum' PeripheralNames.h /clicker/mbed line 27 C/C++ Problem invalid type in declaration before ';' token PeripheralNames.h /clicker/mbed line 26 C/C++ Problem use of enum 'SPIName' without previous declaration PeripheralNames.h /clicker/mbed line 43 C/C++ Problem 'DACName' has a previous declaration here PeripheralNames.h /clicker/mbed line 38 C/C++ Problem using typedef-name 'DACName' after 'enum' PeripheralNames.h /clicker/mbed line 39 C/C++ Problem invalid type in declaration before ';' token PeripheralNames.h /clicker/mbed line 38 C/C++ Problem invalid type in declaration before ';' token PeripheralNames.h /clicker/mbed line 74 C/C++ Problem using typedef-name 'CANName' after 'enum' PeripheralNames.h /clicker/mbed line 75 C/C++ Problem 'CANName' has a previous declaration here PeripheralNames.h /clicker/mbed line 74 C/C++ Problem invalid type in declaration before ';' token PeripheralNames.h /clicker/mbed line 56 C/C++ Problem using typedef-name 'PWMName' after 'enum' PeripheralNames.h /clicker/mbed line 57 C/C++ Problem 'PWMName' has a previous declaration here PeripheralNames.h /clicker/mbed line 56 C/C++ Problem use of enum 'TimerName' without previous declaration PeripheralNames.h /clicker/mbed line 66 C/C++ Problem invalid type in declaration before ';' token PeripheralNames.h /clicker/mbed line 66 C/C++ Problem using typedef-name 'TimerName' after 'enum' PeripheralNames.h /clicker/mbed line 67 C/C++ Problem 'TimerName' has a previous declaration here PeripheralNames.h /clicker/mbed line 66 C/C++ Problem use of enum 'CANName' without previous declaration PeripheralNames.h /clicker/mbed line 74 C/C++ Problem use of enum 'CANFormat' without previous declaration can_helper.h /clicker/mbed line 13 C/C++ Problem using typedef-name 'CANType' after 'enum' can_helper.h /clicker/mbed line 20 C/C++ Problem invalid type in declaration before ';' token can_helper.h /clicker/mbed line 19 C/C++ Problem 'CANType' has a previous declaration here can_helper.h /clicker/mbed line 19 C/C++ Problem using typedef-name 'CANFormat' after 'enum' can_helper.h /clicker/mbed line 14 C/C++ Problem invalid type in declaration before ';' token can_helper.h /clicker/mbed line 13 C/C++ Problem use of enum 'CANType' without previous declaration can_helper.h /clicker/mbed line 19 C/C++ Problem 'CANFormat' has a previous declaration here can_helper.h /clicker/mbed line 13 C/C++ Problem empty filename in #include main.cpp /clicker line 2 C/C++ Problem use of enum 'PortName' without previous declaration PortNames.h /clicker/mbed line 13 C/C++ Problem using typedef-name 'PortName' after 'enum' PortNames.h /clicker/mbed line 14 C/C++ Problem invalid type in declaration before ';' token PortNames.h /clicker/mbed line 13 C/C++ Problem 'PortName' has a previous declaration here PortNames.h /clicker/mbed line 13 C/C++ Problem make: * [main.o] Error 1 C/C++ Problem

Question relating to:

Any help would be appreciated

posted by Chris Westervelt 18 Jul 2013

2 Answers

11 years, 4 months ago.

I got the same issue with your file.

However with a new project I copy pasted your main.cpp, and exported that (from the normal compiler, not beta-mode, that seems to be doing a bit weird), and then it works fine. So I would just try it again, possibly in a new program.

For reference, this is what I got: /media/uploads/Sissors/clicker_codered_lpc1768.zip (Checked it in Code red for lpcxpresso)

Accepted Answer
11 years, 4 months ago.

Thanks. Your zip works fine. I will try what you said and see if that works better.

Apparently the files I created were old and when I created a new project and pasted the code in, it worked after export/import

posted by Chris Westervelt 26 Sep 2013