English

Error: Fatal error C1067: compiler limit: debug information module size exceeded

Error Message

When using the #import directive to include MO20.ocx, and the project is compiled in debug mode, the following error may occur:

"Fatal error C1067: compiler limit: debug information size exceeded"

Cause

When the project is compiled in debug mode, two files are created in the output directory: Mo20.tlh and Mo20.tli. The error occurs because the declaration of "ProjectedCoordSysConstants" in Mo20.tlh is too large for the compiler to handle.

Solution or Workaround

There are three possible solutions to this problem, depending on the constants needed by the project. Use Method One if able to remove enough constants to prevent the error. If needing to use more ProjectedCoordSystConstants than the system can handle, use Method Two. Finally, use Method Three if you don't need to use the ProjectedCoordSysConstants at all.

  • Method One:

    1. Copy Mo20.tlh and Mo20.tli to the same folder as the rest of the source files.

    2. Change the imports statement to include.

    Code:
    #include "mo20.tlh"


    3. Remove lines from the declaration of ProjectedCoordSysConstants until the project compiles successfully.

    Note:
    Be sure to remove only the constants the project does not need.

  • Method Two:

    1. Instead of declaring a constant in the enum declaration, use:

    Code:
    const int $myCS = $myValue;


    Note:
    $myCS is the name of the constant and $myValue is the ID number for the coordinate system.


    2. When needed, use a typecast to convert the constants to the correct type.

    Code:
    static_cast<enum ProjectedCoordSysConstants> ($myCS);

  • Method Three:

    Use exclude code on the #import to stop the enum from being imported.