Show: Object Pascal C++
Display Preferences

Resolving Internal Errors (C++)

From Appmethod Topics
Jump to: navigation, search

Go Up to Debugging Applications Index

Internal Compiler Errors

There are three kinds of errors that the C++ compiler generates that are considered to be ICEs:

All three of these result from bugs in the compiler. The <filename> and <line> elements are the point in your source code that the compiler was parsing prior to the error, but may or may not indicate the source of the problem. The <errorcode> element is specific information to tell the compiler engineers what the compiler was trying to do when the error occurred.

What to do if you encounter an internal compiler error

  1. Remember that your code may not be at fault.
  2. Try a clean build.
  3. Analyze the source to narrow the problem.
  4. Submit a bug report.

How to perform a clean build

  1. Right-click the project in the Project Manager and select clean.
  2. Check the directory structure to make sure there are no .obj .tds .dcu .#* or .pch files associated with your project.
  3. Choose Build from the Project menu.


How to analyze the source code

If a clean build does not resolve the problem, you may want to analyze the source code to narrow down the problem.

  1. Preprocess the file that is mentioned in the error message. This can be done by right-clicking the file in the Project Manager and choosing preprocess. This will generate a file with no external dependencies for compilation, and it might be a very large file.
  2. Compile the preprocessed file with the -P switch. If this is sufficient to reproduce the problem, you may go straight to step 4.
  3. If the .i file compiled correctly, there may be additional switches needed to reproduce the problem. Recompile the .i file adding any switched used for the original command line build until you determine which switches are needed to reproduce the problem.
  4. This is enough information to file a bug report. If you do not wish to narrow down the problem any further please go to the instructions for filing a bug report.
  5. You can delete anything after the line where the error occurs and any comments.
  6. Start to comment out function bodies and other portions of code which may not have anything to do with the problem.
  7. As you determine portions which are not necessary to reproduce the problem, you may delete those sections from the .i file.
  8. Once you have narrowed down the elements of code necessary to reproduce the problem, you can then submit a bug report and analyze the type of constructs used to try and find a workaround

How to file a bug report:

  1. Choose Quality Central from the Tools menu in the IDE.
  2. Click on the '+' button to create a new report.
  3. Choose Appmethod C++ as the project.
  4. Choose Compiler/C++ as the area.
  5. Enter the command line needed to reproduce the error in the steps of the bug.
  6. Attach the .i file.
  7. Click the check mark button to save the report.

See Also

Personal tools
In other languages