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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/21/05 14:09
Read: times


 
#85503 - EXTERN needs corresponding definition!
Responding to: ???'s previous message
Every 'extern' declaration must have a corresponding definition somewhere - this is what "resolves" the external reference.

You should take the _at_ off your 'extern' declarations in the header file, and put it into the definitions elsewhere in your project.
blah.h
EXTERN xdata volatile BYTE PORTBCFG; 
EXTERN xdata volatile BYTE PORTCCFG; 
EXTERN xdata volatile BYTE OUTB; 
EXTERN xdata volatile BYTE OUTC; 
EXTERN xdata volatile BYTE OEB; 
EXTERN xdata volatile BYTE OEC; 

blah.c
#include "blah.h" // this allows the compiler to spot any inconsistencies!

xdata volatile BYTE PORTBCFG _AT_ 0x7F94;
xdata volatile BYTE PORTCCFG _AT_ 0x7F95;
xdata volatile BYTE OUTB _AT_ 0x7F97;
xdata volatile BYTE OUTC _AT_ 0x7F98;
xdata volatile BYTE OEB _AT_ 0x7F9D;
xdata volatile BYTE OEC _AT_ 0x7F9E;

List of 3 messages in thread
TopicAuthorDate
Writing to 8051-CY7C6461 registers in C            01/01/70 00:00      
   EXTERN needs corresponding definition!            01/01/70 00:00      
   Cypress Header Files            01/01/70 00:00      

Back to Subject List