Corrupt Object File

Sometimes the linker is unable to process your object files because they are corrupt. Besides the usual causes of corrupt files such as network problems or exposing a floppy disk to a magnetic field, sometimes the compiler writes an incorrect object file, which you should report to Microsoft Product Support Services. See the Technical Support command on the Help menu for more information.

After you have ruled out a hardware, operating system, or network problem as the cause of the corrupt object file, you should try the tips below because sometimes by changing compiler options and recompiling, the compiler will write a non-corrupt object file.

Here are some things to try when recompiling:

  • Turn off optimization with the /Od (Disable) option.

  • Disable incremental compilation with the /Gi– (Enable Incremental Compilation) option.

  • Disable minimal rebuild with the /Gm– (Enable Minimal Rebuild) option.

  • Compile with the /Gy (Enable Function-Level Linking) option to package functions.

  • Use a different code generation option. See the /G (Optimize for Processor) options.

  • Change the order of functions and global variables.