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...
C51 FATAL-ERROR - ACTION: ALLOCATION MEMORY ERROR : MEMORY SPACE EXHAUSTED C51 TERMINATED I know the error because of memory, but don't know where? This means that you have crashed the compiler itself - it has run out of PC memory and is unable to continue processing your source files. This has nothing to do with memory in your 8051 target! The Fata Errors are described here: http://www.keil.com/support/man/docs/c51/c51_er_fatalerror.htm Remember, you are going to have to read the manuals in detail to complete this task. If you are not prepared to do that, you should give up now! What is this VC code that you are trying to port to C51? Are you sure that it is suitable for an 8051...?
Hi, Tks all for you helpful advices. As Neil advised, I tried to read the C51 manual as much as I can. Let me tell you my situation. My boss needs me to convert a POS program which before run on Verifone terminal into Ingenico terminal. I'm using Ingenico development (Ingedev 2.31) now. I'm new and somehow lost. Back to my problem, syntax errors were solved. The program trys to use some C51 keywords as variables. However, the memory error still happens. I tried to limit the global symbols (#define) and external symbols (extern), each less than 256. Besides, there is one module which has 121 functions. I'm afraid it may exceed the limited segments. Do you guys think so? And what else needs to be considered? Please advice. Tks, Quang.
How big is this program? Will it fit into 64K? Do you plan to use code pages. Try to compile one C module at a time. It may help you to narrow down the problem.
View all questions in Keil forum