C1067: compiler limit

J

John L

I'm rebuilding some apps that were last built with V5.
The main fixup is to use new iostreams instead of old .h
files. However it seems that any module that includes one
of the iostreams headers gives the error
fatal error C1067: compiler limit : debug information
module size exceeded

pointing to some line in a system header file (eg xmemory)

MSDN KB has info about this problem with very early
versions of the compiler - but I can't relate to my issue.

Can aviod error by compiling without debug info but that
makes debugging very difficult!

Any advice most apreciated.
John
 
G

Gary Chang [MSFT]

Hi johnlaus,

Thanks for you posting in the group!

The C1067 error can be caused by a symbol with a decorated name that
exceeds 247 characters.
So you can try the following workaround to handle the problematic symbol
source:

1. Use "chaining" inheritance. Break the class up into multiple classes
where
each class inherits from the previous class. The final class will contain
member variables for all of the other classes through inheritance. As long
as
you limit the number of variables in each class, you should avoid the C1067
error.



2. Use multiple inheritance. Break the class up into multiple classes.
Then
create one new class that multiply inherits from all of those classes. As
long as the member variables are unique in each class, this should not
present
too many complications.



Note: When working with such large classes, you get a tremendous performance
improvement in the build by separating each class into its own source file.

Using precompiled header files will also improve performance here.

Hope that helps!


Best regards,
Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

John L

Hi Gary,

Thank you for your prompt response. I'm afraid your
solution was not viable as the error was triggered by
many source files and never indicated a particular class
declaration. We have several 100K lines of legacy code.

By a process of elimination I tracked the problem to a
header that declares a set of very large structs (a
couple around 3000 fields). The structs are then nested
in another (combining around 8000 fields) - very UGLY I
know but it is the specification of a shared memory area
that interfaces to some very old FORTRAN code and would
be difficult to redesign.

I eventually tracked down a pragma that solved the
problem!

I have wrapped the struct declarations in:

#pragma component(mintypeinfo, on)
..
..
..
#pragma component(mintypeinfo, off)

Now I can compile with ZI (or Zi) and all is OK

Regards,
John
 
G

Gary Chang [MSFT]

Hi John,

Thanks for your quickly response!

I am very delightful to know you have resolved the problem, and thanks to
share your valuable resolution with the community members.


Best regards,
Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top