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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/26/11 08:23
Read: times


 
#181320 - Multiple public definitions in code banking
Hi

We are using 8052 in our project. We are using Keil C51 cross-compiler. Initially, our project code is below 64K. We defined numerical constants in the code as shown:

unsigned char code MAX_LINES = 100;

As the code increased due to more features upgrading, we implemented Code Banking of Keil with 2 code banks. Then, for the numerical constants definition, Keil compiler generated the Error:

Error L104 Multiple Public Definitions

So, We defined numerical constants in the code as shown:

const unsigned char code CA_MAX_LINES = 100; /* For Common area module */

const unsigned char code FB_MAX_LINES = 100; /* For Bank 0 module */

const unsigned char code SB_MAX_LINES = 100; /* For Bank 1 module */

These are defined seperately in the individual header files of the modules, and they are used in almost 150 locations in each file.

This is a single project with common area and 2 code banks. Logically, a single definition must solve the purpose.

Q. How to get rid of the error L104 when defining a single numerical constant, apart from creating 3 individual definitions for each module?

Please suggest.

Thanks in advance


List of 15 messages in thread
TopicAuthorDate
Multiple public definitions in code banking            01/01/70 00:00      
   single const byte in code            01/01/70 00:00      
      The meaning of 'const' in ANSI 'C'            01/01/70 00:00      
         Yes            01/01/70 00:00      
            Keil C51 isn't a C++ compiler            01/01/70 00:00      
      Coding Standard Rules - Netrino            01/01/70 00:00      
         Rule #2 is a bit broken or at least incompletely formulated            01/01/70 00:00      
         issue with #define usage            01/01/70 00:00      
      extern const code declaration            01/01/70 00:00      
         Insufficient detail            01/01/70 00:00      
         Conceptually wrong            01/01/70 00:00      
            Thanks, it's working !            01/01/70 00:00      
               Why?            01/01/70 00:00      
                  correction            01/01/70 00:00      
   Fundamental 'C' programming error!            01/01/70 00:00      

Back to Subject List