This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

TYPE GEN: TYPE TOO COMPLEX

This is the error message I get. The projext is for the NXP P80C51MC2. The code size is around 400K bytes. This occurs after I add another instance of a structure to the code. I have about 450 instances of this structure. I can take out one of them and the problem goes away. This project is several years old and we add code to it on occasion. The error occurs during the compile of the C file that includes the header file with the structures. I have tried splitting the header file up, but that did not help. Any ideas?

I am using Keil 8.05a on Win2000.

Parents
  • Actually 434 instances in a header file and 132 instances in a C file.

    This bears hints of possible foul play, by itself. You might be mixing up definitions and declarations.

    There should never, ever, be 434 instances of anything in a single header file. Certainly not 434 definitions. Definitions go to the C file. And if those 132 instances in the C file are definitions, there should be a header file with the 132 declarations to go with that. Not 434.

Reply
  • Actually 434 instances in a header file and 132 instances in a C file.

    This bears hints of possible foul play, by itself. You might be mixing up definitions and declarations.

    There should never, ever, be 434 instances of anything in a single header file. Certainly not 434 definitions. Definitions go to the C file. And if those 132 instances in the C file are definitions, there should be a header file with the 132 declarations to go with that. Not 434.

Children
  • Not always. I use the header file not to decalare public access but to break up files into manageable chunks. Since header files are included inline with the code it makes a nice way of cutting the file you look at down. Maybe it's not Ansi C but it makes my life easier. Only one file includes this header.