Link to home
Start Free TrialLog in
Avatar of naseeam
naseeamFlag for United States of America

asked on

How to solve "expected an expression" error?

I'm using Keil tools uVision V4.71.2.0.  C compiler Armcc.Exe version V5.03.0.69.
I'm working on large code base.

The following is the error from the compiler:

Build target 'Proj1_Debug'
compiling RTX_Config.c...
C:\Keil\ARM\RV31\INC\RTX_lib.c(185): error: #29: expected an expression
Target not created

Line 185 in RTX_lib.c is as follows:

#if (__ARM__ && __RTA_RTX_CONFIG)

what might be the problem?
Avatar of mccarl
mccarl
Flag of Australia image

Can you post some of the code either side of that line too?
Avatar of naseeam

ASKER

I think I found the problem.


Filename RTX_lib.c has the #if condition as follows:

#if (__ARM__ && __RTA_RTX_CONFIG)     // error is "expected an expression"


Filename RTX_Config.c has the following definition:

#define __RTA_RTX_CONFIG

Now, this error makes sense. Since __RTA_RTX_CONFIG is empty, there is no expression.
But I cannot understand how RTX_lib.c knows about __RTA_RTX_CONFIG because it's defined
in a different .c file?

I'm new to some large code base which uses Keil Development Tool based on ARM 7 Processor.
ASKER CERTIFIED SOLUTION
Avatar of sarabande
sarabande
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of naseeam

ASKER

The file compiles now and I can build my target.  What I don't understand is how does RTX_lib.c knows the value of __RTA_RTX_CONFIG macro.  This macro is defined in a different C file.  

I'm using Keil uVision V4.71.2.0 operating system.  It seems like lot of things are happening behind scenes.  RTX_lib.c is Keil's operating system file.  This operating system is in my hard drive.
such macros also can be passed from outside to the compiler either by command (normally with -D<macro>) or by makefile/projectfile option. some macros also may be set by the compiler, for example macros specifying the operation system and version numbers.

Sara