??? 01/10/08 16:07 Read: times |
#149231 - Multiple Definitions Responding to: ???'s previous message |
Juan Carlos said:
Note that 'C' is case-sensitive, and your program's entry point must be named 'main' - with a lowercase initial 'm'!! These two files Main.c and Calc.c share a common variable.h file.
After compiling this is what I get: ERROR L104: MULTIPLE PUBLIC DEFINITIONS That will be because your header file contains definitions of the variables; therefore, each file that includes it will contain those definitions. Because you include it in multiple (ie, more than one) files, that will mean that your project will have multiple definitions - just as the message says! You header file should contain only declaration, and each variable should be defined in one - and only one - .c file. This is standard 'C' textbook stuff - nothing specifically to do with Keil nor the 8051! See: http://c-faq.com/decl/decldef.html |