Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/14/07 22:19
Read: times


 
#143290 - re: thanks
Responding to: ???'s previous message
Rodrigo Lamounier Teixeir said:
Hi, Thanks for the tips, I defined a variable for TMOD it returned 0 errors. But unfortunately it return 3 warnings! lolol

On the beguinning I wrote:

"c:KeilC51IncAtmelReg53.H"

#define __AT89S8252_H__
#ifndef __AT89S8252_H__


Build target 'Target 1'
compiling programa#1.C...
programa#1.C(121): warning C316: unterminated conditionals
PROGRAMA#1.C(121): error C141: syntax error near ''
Target not created


Two problems, one major (and fatal), one less so but still vitally important:

a) Looks like you forgot the #endif that closes the #ifndef. That's likely to be the cause of warning C316, which leads to error C141.

b) Put the #define AFTER the #ifndef. In your code, since you've explicitly #defined __AT89S8252_H__ before you test to see if it's not defined, the #ifndef will ALWAYS be FALSE (it IS #defined) so the stuff that needs to be included is never included, so for example your TMOD sfr is never defined.

-a

List of 17 messages in thread
TopicAuthorDate
Programming in C#            01/01/70 00:00      
   looks like C to me            01/01/70 00:00      
      Me too!            01/01/70 00:00      
         Thanks!            01/01/70 00:00      
            Back to basics!            01/01/70 00:00      
               project!            01/01/70 00:00      
                  Have you discussed this with your supervisor(s)?            01/01/70 00:00      
                     Problem!            01/01/70 00:00      
                        no problem            01/01/70 00:00      
                           know problem            01/01/70 00:00      
                              correct            01/01/70 00:00      
            re: thanks            01/01/70 00:00      
   Read what the message tells you!            01/01/70 00:00      
   not Keil C            01/01/70 00:00      
      the Nops            01/01/70 00:00      
   Gee .. I thought that was for BIG prorgams.            01/01/70 00:00      
      Gee.that is a big problem but im not at that level            01/01/70 00:00      

Back to Subject List