Identifier Problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Identifier Problem

470 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rithus on Sat Apr 12 01:00:53 MST 2014
Hi, does anyone know the solution of problem. This error was prompt on the debugged side of the lib.

* @brief Boolean Type definition
*/
[u]typedef enum {FALSE = 0, TRUE = !FALSE} Bool;[/u]

/**
Console screen:
new workspace\Lib_MCU\inc/lpc_types.h:45: error: expected identifier before '(' token
make: *** [src/usbcontrol.o] Error 1

i have also attach an image of the error shown.
0 Kudos
Reply
7 Replies

421 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Sat Apr 12 08:42:19 MST 2014
This is not LPCXpresso - it is plain old C.

Get yourself a good C book and learn about pre-processor macros (#define), constants and enums.
0 Kudos
Reply

421 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rithus on Sat Apr 12 03:13:37 MST 2014
Hi,thanks for your promptly reply!
i am quite new to LPCxpresso so in this case i dont have to declare False=0?

typedef enum {FALSE , TRUE } Bool; ?

really appreciate your help here! thanks!

0 Kudos
Reply

421 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Sat Apr 12 02:52:16 MST 2014
It is because in type.h, you have
#define FALSE (0)
0 Kudos
Reply

421 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rithus on Sat Apr 12 02:15:41 MST 2014
I have also attached my project folder if it helps..
0 Kudos
Reply

421 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rithus on Sat Apr 12 02:08:28 MST 2014
Hi thanks for ur fast reply..this is the code that i am using now..i am not sure is it because i included two similar library that causes this problem
0 Kudos
Reply

421 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Sat Apr 12 01:46:36 MST 2014
I think you are looking in the wrong place for your error - that line compiles OK for me.

My guess is that you are missing a ";" on the previous statement (that you have not shown us).
0 Kudos
Reply

421 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rithus on Sat Apr 12 01:10:34 MST 2014
The whole error msg is shown below:

Invoking: MCU C Compiler
arm-none-eabi-gcc -DDEBUG -D__USE_CMSIS=Lib_CMSISv1p30_LPC17xx -D__CODE_RED -D__REDLIB__ -I"C:\Users\HW\Desktop\new workspace\RDB1768cmsis_usbstack\inc" -I"C:\Users\HW\Desktop\new workspace\Lib_MCU\inc" -I"C:\Users\HW\Desktop\new workspace\Lib_CMSISv1p30_LPC17xx\inc" -O0 -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -mcpu=cortex-m3 -mthumb -MMD -MP -MF"src/usbcontrol.d" -MT"src/usbcontrol.d" -o"src/usbcontrol.o" "../src/usbcontrol.c"
In file included from C:\Users\HW\Desktop\new workspace\RDB1768cmsis_usbstack\inc/usbstruct.h:39,
                 from ../src/usbcontrol.c:57:
C:\Users\HW\Desktop\new workspace\Lib_MCU\inc/lpc_types.h:45: error: expected identifier before '(' token
make: *** [src/usbcontrol.o] Error 1
0 Kudos
Reply