We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi! I'm a newbie with using Keil C-51 Compiler! I want to compile a sourcecode and always recive Error 107 unbalanced #if-endif controls! I've looked to all statements and i can not find any mistakes! There is another one! Error 106 unclosed comment! In the compiler discribtion is written: it occurs if there is a '*/' missing, but i don't use comments like this /*--*/ only // comments! because if i am using this /*--*/ type the there is apearring another Error: like this error 141 in line ... near '/' please could anybody help me or give me an advise which is probably wrong! Thanks DANIEL
are you sure you version of the compiler supports // ? They did not always support it.
Well! I am sure that the compiler supports '//' I've changed a couple of things for example i deleted all '*' in the comments and used '//' for '/*-*/' in all files! Moreover i set all #if to #ifdef Now there is no longer the error message #if-endif and unclosed comment! But instead of being free of errors i get about 50 more syntax errors!!! It is really frustrating! Ok! I had to life with the error messages, but i don't understand that the original source is compileable at the newest version, without any problems! Have they changed so many thing? Best regards DANIEL
I am using Keil C51 Compiler Version 3!!!! Have they changed so many thing? Well, we're currently shipping C51 version 7. Version 3 was released sometime around 1991. So, yes, in 13 years I'm sure some things were changed. Jon
Have you looked at the preprocessor listing yet?
When having mismatched #if..#endif problems myself some time ago, I wrote a little PC utility to check them - I'll see if I can find it again... Meanwhile, have you tried GREP?
Well, now have i solved the most errors! It seems to be that the compiler don't like #defines which are calling a other #define for example: #XXX 10 #YYY 1000/XXX I think it causes the most problems. Now there only 4 errors left! I think i could solve them by myself, too. Thanks to all which have replaied! I'll be back!!! :) I am sure with new problems! Best regards DANIEL