Re-declaration Error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re-declaration Error

1,119 Views
ronjaeger
Contributor II

I am using CodeWarrior for MCU 10.3 and have the following declaration:

typedef enum

{

   EEPROM_DIRECT_INVALID_MESSAGE = -2,

   EEPROM_DIRECT_EEPROM_ERROR = -1,

   EEPROM_DIRECT_SUCCESS = 0

} EEPROM_DIRECT_ERRCODE_T;

 

This is referenced in the following struct:

typedef struct EEPROM_DIRECT_TAG

{

   OS_EVENT* eeprom_direct_sem;

   EEPROM_DIRECT_ERRCODE_T eeprom_direct_result;

   U32 address;

   U16 size;

   U8 data[4];

} EEPROM_DIRECT_T;

 

In the enum typedef I'm getting the error:

identifier 'EEPROM_DIRECT_ERRCODE_T' redeclared was declared as: 'int' now declared as: '@enum$669warranty_c'

 

I have no idea what 'enum$669warranty_c'.  There is no reference to it in the code.  There is a code module named warranty.c, but it has nothing to do with this code.

 

The struct then, of course, complains that EEPROM_DIRECT_ERRCODE_T is undefined.

There is no other reference to EEPROM_DIRECT_ERRCODE_T, so I don't understand how it could be re-declared.

 

 

Labels (1)
0 Kudos
8 Replies

887 Views
ronjaeger
Contributor II

V 10.3 is the latest we have.  The compiler settings were copied from another CodeWarrior project that compiles ok.

What are my options for support?  You can't really expect a company to post their entire source code on the internet.  It seems like we really need on-site support.

Ron

0 Kudos

887 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Ron,

This problem seems to be caused by the header files include order in the project. Please try deleting the include of eeprom_rw.h that is inside warranty.c and instead include the aldl_can.h file.


Hope it helps!

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 Kudos

887 Views
martin_kovar
NXP Employee
NXP Employee

Hello Ron,

I absolutely understand your situation and I do not expect you will share this project in public. These big projects are anyway out of scope unpaid technical support. I can recommend to contact your NXP representative. If you do not have NXP representative, please look at the following link:

Distributor Network|NXP 

Hope it helps a little bit.

Regards,

Martin

0 Kudos

887 Views
ronjaeger
Contributor II

The code set has 335 source files, and it is proprietary.  But here are the two source files generating the problem (attached).  These are the errors:

dentifier 'EEPROM_DIRECT_ERRCODE_T' redeclared was declared as: 'int' now declared as: '@enum$669warranty_c' eeprom_rw.h /MLEC-BAE-UCOS-CW/Sources/app/eeprom_rw    line 50 C/C++ Problem

identifier 'SENSCAL_ERRCODE_T' redeclared was declared as: 'int' now declared as: '@enum$668warranty_c'       eeprom_rw.h /MLEC-BAE-UCOS-CW/Sources/app/eeprom_rw    line 43 C/C++ Problem

mingw32-make: *** [Sources/app/warranty/warranty_c.obj] Error 1                                              MLEC-BAE-UCOS-CW                                              /C++ Problem

undefined identifier 'EEPROM_DIRECT_ERRCODE_T'                                                                aldl_can.h /MLEC-BAE-UCOS-CW/Sources/app/ext_can/aldl line 74 C/C++ Problem

undefined identifier 'SENSCAL_ERRCODE_T'                                                                      aldl_can.h /MLEC-BAE-UCOS-CW/Sources/app/ext_can/aldl line 55 C/C++ Problem

As you can see, I'm getting the same error on SENSCAL_ERRCODE_T.  The only connection to warranty.c is that it includes eeprom_rw.h.

Ron

0 Kudos

887 Views
martin_kovar
NXP Employee
NXP Employee

Hello Ron,

I created project and added your files, but it works correct on my side. I do not get any compile error. It look like some misconfiguration in your header files, but if the project is so big and confidential, it is out of my scope to provide you better advice.

Did you try your code in some newer version of CodeWarrior (10.6 or 10.7)?

Do you use default compiler settings?

Regards,

Martin

0 Kudos

887 Views
ronjaeger
Contributor II

We are using the NXP 5605B processor.

Ron

0 Kudos

887 Views
martin_kovar
NXP Employee
NXP Employee

Hello Ron,

I tested your code on my side and it works correct. Could you please share your project or at least a part of project which demonstrates your problem and which could be compiled to test it on my side?

Regards,

Martin

0 Kudos

887 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Ron.

Thank you for contacting us.

What chip do you work with?


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos