Hi guys, have you ever tried to do that? Can give me some experience? I got some stupid error msgs which I can not find out why?
How well do you know 'C' in general? How well do you know MSVC? How well do you know the Keil tools? How well do you know the underlying 8051 architecture? Remember: * VC is C++ * A PC is a large, 32-bit machine; an 8051 isn't * Data sizes, byte ordering, calling conventions, alignment & padding are all impementation-specific - they will be different! * You are going to have to do a lot of reading in the Keil Manuals, knowledge base, application notes, etc. "I got some stupid error msgs which I can not find out why?" All the error messages are listed & explained in the Manual. Also, in uVision, just click the error message, then press F1 for its description. Read the messages Literally You will, of course, need a thorough understanding of the specifics of Keil's C51 implementation and of the underlying 8051 architecture to make sense of them...
*** ERROR 141 IN LINE 112 OF INC\GLOBAL1.H: syntax error near '0' *** ERROR 141 IN LINE 10 OF INC\TYSTRUCT.H: syntax error near '[' *** ERROR 141 IN LINE 10 OF INC\TYSTRUCT.H: syntax error near ']' *** ERROR 141 IN LINE 21 OF INC\TYSTRUCT.H: syntax error near '}' *** ERROR 141 IN LINE 262 OF INC\TYSTRUCT.H: syntax error near ';' *** ERROR 141 IN LINE 273 OF INC\TYSTRUCT.H: syntax error near '}' *** ERROR 141 IN LINE 174 OF INC\HIGH_API.H: syntax error near ',' I tried to look at the source code at the error line but see nothing wrong. C51 FATAL-ERROR - ACTION: ALLOCATION MEMORY ERROR : MEMORY SPACE EXHAUSTED C51 TERMINATED I know the error because of memory, but don't know where? Tks a lot.
Wild guess: some set of recusive #defines that overflow limits of the Keil preprocessor? Are those all the errors that you get? Do you have all the necessary typedefs for the headers already ported? Can you generate the output from the preprocessor and post the results of that? Posting the relevant lines of source might help.
I'm going to take a wild guess here, Houdini predicts that there is a structure containing an array of whatever and the "SIZE OF.." define got out of hand.
"I tried to look at the source code at the error line but see nothing wrong." The error's in a header file - so it's most likely to be a missing or incorrect definition (eg, typedef or #define) some where before where the first error is reported. Are you sure that you have all the command-line defines correct? Try Andy's Handy Hint for Debugging Preprocessor Problems - Examine the preprocessor output: http://www.8052.com/forum/read.phtml?id=29152 Note that the preprocessor listing is a valid 'C' source file. Try compiling it - then you will get error messages that relate directly to the source as the compiler sees it - without any preprocessor obfuscation...
"Try Andy's Handy Hint for Debugging Preprocessor Problems - Examine the preprocessor output" Here is the Keil Manual page regarding the preprocessor listing: http://www.keil.com/support/man/docs/c51/c51_cm_ifile.htm
View all questions in Keil forum