Fatal Error C1001

  INTERNAL COMPILER ERROR
(compiler file file, line number)

Possible causes

  • The first compiler failed while attempting to recover its state following the detection of a syntax error. Fixing the syntax errors in your code should solve the problem.
  • The code generator cannot generate correct code for a construct, probably due the combination of an expression and an optimization option. Try removing one or more optimization options and recompiling the function containing the line indicated in the error message.

If the compiler emits no error messages prior to this internal compiler error, determine which compiler pass emitted the internal error by recompiling the application with /Bd. The /Bd option causes each compiler pass to print its name and arguments. Look for the last pass invoked before C1001 occurs.

If the last pass is P1, then the likely cause is recovery from a syntax error, which the compiler cannot print before the internal error occurs. Examine the line where the internal error occurs and the previous line. Those lines may contain a syntax error. Fixing any errors you find. If you cannot find an error, contact Microsoft Technical Support.

If the last pass is P2, you can probably fix the problem by removing one or more optimization options (or using a different code generator). To determine which option is at fault, remove options one at a time and recompile until the error message goes away. The options most commonly responsible are /Og, /Oi, and /Oa. Once you determine which option is responsible, you can disable it using the optimize pragma for the function where the error occurs and continue to use the option for the rest of the module.

A C1001 error in the P2 pass occurs rarely at low optimization levels or when optimization is disabled. If this happens, try rewriting the line where the error is reported, or several lines of code surrounding that line. If that doesn't work, contact Microsoft Technical Support.