I'm getting a C1421 error when I compile but the IDE finds the declaration just fine....

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

I'm getting a C1421 error when I compile but the IDE finds the declaration just fine....

1,374 Views
Yachtsman
Contributor I

I moved the files from an older version of CodeWarrior that is no longer supported by version 10.6.

 

The code all compiled fine on the older version.  I'm having a hard time getting things to work on the new version.

 

I'm assuming that I'm missing something with the path to the include files.

Labels (1)
0 Kudos
11 Replies

868 Views
trytohelp
NXP Employee
NXP Employee

Hi Patrick,

difficult to provide you more information that the error description:

+++++++++++++++++++++++++++++++++++++++

C1421: Undefined class/struct/union

[ERROR]

Description

An undefined class, structure or union was used.

Example

void f(void) { 

  struct S *p, *p1; 

  *p=*p1; 

} 

Tips

Define the class/struct/union.

+++++++++++++++++++++++++++++++++++++++

Probably a header file is missing.

This seems to be the cause of the issue.

If you're importing an old project created under classic IDE to Eclipse version, you can refer to ANs.

There are 2 ANs explaining the process depending of the architecture used.

                AN4727, Import project from CW clasic to CW MCU v10 4 CodeWarrior for Microcontrollers v10.4

                        http://cache.freescale.com/files/soft_dev_tools/doc/app_note/AN4727.pdf

            AN4104, Converting ColdFire Projects to CodeWarrior Development Studio for Microcontrollers V10.0

                                http://cache.freescale.com/files/soft_dev_tools/doc/app_note/AN4104.pdf

Hope this will help you.


Have a great day,
Pascal

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

0 Kudos

868 Views
Yachtsman
Contributor I

Thanks for the input. 

I have not imported an old project as the import tool did not allow it.  Reported an unsupported tool chain.

I created a new project and did "add file" for all the needed .C & .H files.  They are all visible in the Coldwarrior Project window.  All *.c files are in the "Source" directory and all the *.h files are in the "Project_Headers" directory. 

Under Project properties - C/C++ General - Paths and symbols - Includes I have a pointer to the project_headers directory.

There is a pointer to the project directory and the sources directory.

When I compile the first error I get is C1421 Undefined class/struct/union.  When I click on the error it takes me to the code line in question. 

When I right click on each element in the line and open the declaration it takes me to the appropriate line in the header file.

That indicates to me that everything is declared and the IDE is finding it fine. 

There must be something else I'm missing but I have tried everything that I can find.  

Having said that I just reinstalled version 6.3 and went back to my old project and everything builds fine.

I wanted to update because the old version does not run on 64bit.  Guess I'll just keep using the old version on another dev machine.

Later -

0 Kudos

868 Views
trytohelp
NXP Employee
NXP Employee

Hi Patrick,

I think something is missing in your project.

By default all the header files must be located physically under Project_headers folder.

To continue to investigate the problem it should be interesting to reproduce the problem on our side.

      Can you please provide me your application ?

By default CW for MCU V6.3 is not running under 64 bit.

In fact it's not possible to install it because the installer is checking the OS version used.

In case of 64 bit, the installer detects it and will stop the installation.

There is a way to install it under 64 bit:

      - install it under 32 bit OS,

      - copy installation under 64 bit machine,

      - execute the \bin\regserver.bat,

      - install the last P&E driver under their web site:

            P&E Microcomputer Systems - USB BDM Multilink Cable - USB BDM Interface cable for the 68HC(S)12(X) a...


Have a great day,
Pascal

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

0 Kudos

868 Views
Yachtsman
Contributor I

I appreciate you looking at this - I'm sure I'm doing something stupid but I can't find it. 

I'd rather use 10.6 if I can.

As I said this code builds under 6.3.  The difference is that under 6.3 it is in 2 directories because part of the code is used in other projects.

I finally combined everything in to one directory hoping it would build.

0 Kudos

868 Views
trytohelp
NXP Employee
NXP Employee

Hi Parick,

I extracted the project and build it under MCU V10.6.

I get 51 errors associated to the Nowire.c file.

I've extracted the preprocess file and tried to compiler it under MCU V6.3 and I get same errors message (51 errors).

the problem is definitely linked to the project architecture.

Is it possible to have the running example created for MCU V6.3 ?

It will help me to understand the problem under MCU V10.6.


Have a great day,
Pascal

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

0 Kudos

868 Views
Yachtsman
Contributor I

Here is code that builds fine on my 6.3 installation except for 2 warnings.

The main directories are Tank Controller 2.0 and Tank Device 2.0. 

The nowire directory has coded that is shared. 

I hope this helps and thanks again for looking at this.

0 Kudos

868 Views
Yachtsman
Contributor I

Have you had a chance to look at the code? 

I need to decide whether to try to proceed with 10,6 or just fall back to 6.3.

0 Kudos

868 Views
trytohelp
NXP Employee
NXP Employee

Hi Patrick,

The 32K zip file contains 3 folders:

      - NoWire Utilities -> contain source and header files,

      - Tank Controller 2.0 -> seems to be a project folder but ... without .mpc file,

      - Tank Device 2.0 -> contains the project folder including project file Tank Device 2.0.mcp.

the Tank Device 2.0.mcp file seems to be old file with June 25th 2010 date.

Under my MCU V6.3 I was able to open the project and build it.

Now I've launched MCU v10.6 and created a new project.

I've added all source files used in the V6.3 project including the prm file too.

I'm able to build the project without error and other warning.

Attached you will find the project.
Have a great day,
Pascal

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

0 Kudos

868 Views
Yachtsman
Contributor I

I imported the project and built it under 10.6 and there are no errors.

Thanks!

I still don't know what I was doing wrong.  I see you moved all the files into source and project headers. 

In at least a few of my iterations I tried that with no success.

If I want to keed the "Nowire" files in a separate directory that I can share among other projects should I be able to "link" to those files instead of copying them in?  Of course, I tried that several times before with no success. 

Did you find any that I was obviously doing wrong?

0 Kudos

868 Views
trytohelp
NXP Employee
NXP Employee

Hi Patrick,

I'm pretty sure something was missing but it's always difficult to find the cause of the problem.

Most of the time (for this type of issue), it's more easy to re-start the operation than try to solve the problem on project.

For sure having a new eyes on the project could be useful too.


Have a great day,
Pascal

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

0 Kudos

868 Views
trytohelp
NXP Employee
NXP Employee

Hi Patrick,

Sorry for the delay.

I was out of the office last week (Internal training) with limited emails access.

I will check it now and will provide you feedback before the end of day.


Have a great day,
Pascal

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

0 Kudos