To correct this error, divide your source file into multiple source code files, compile without /Gy, or compile with /bigobj. If you do not compile with /Gy, you will need to specify the optimizations individually, since /O2 and /O1 both imply /Gy.
If possible, compile without debugging information.
You may also need to have specific instantiations of templates in separate source code files, rather than having the compiler emit them.
When porting code, C1128 will likely appear first when using the Itanium (IPF) compiler, and then with the x64 compiler, and much later with the x86 compiler. IPF will have at least 4 sections associated with each function compiled /Gy or inlined from templates or class-inline: code, function descriptor, pdata, and debug info, and possibly xdata. x64 will be the same except for the function descriptor. X86 won’t have the pdata.