指定输出文件各节的对齐位置。Specifies where to align the sections of the output file.




必需。Required. 一个值,用于指定输出文件中各节的对齐方式。A value that specifies the alignment of sections in the output file. 有效值为 512、1024、2048、4096 和 8192。Valid values are 512, 1024, 2048, 4096, and 8192. 这些值以字节为单位。These values are in bytes.


可以使用 -filealign 选项来指定输出文件中各节的对齐方式。You can use the -filealign option to specify the alignment of sections in your output file. 节是可移植可执行 (PE) 文件中包含代码或数据的连续内存块。Sections are blocks of contiguous memory in a Portable Executable (PE) file that contains either code or data. -filealign 选项允许你使用非标准对齐方式编译应用程序;大多数开发人员不需要使用此选项。The -filealign option lets you compile your application with a nonstandard alignment; most developers do not need to use this option.

每一节都与边界一致,该边界是 -filealign 值的倍数。Each section is aligned on a boundary that is a multiple of the -filealign value. 没有固定的默认值。There is no fixed default. 如果未指定 -filealign,编译器将在编译时选取默认值。If -filealign is not specified, the compiler picks a default at compile time.

通过指定节的大小,可以更改输出文件的大小。By specifying the section size, you can change the size of the output file. 修改节的大小可能对将在较小设备上运行的程序有用。Modifying section size may be useful for programs that will run on smaller devices.


-filealign 选项在 Visual Studio 开发环境内无法使用;仅当从命令行编译时才可用。The -filealign option is not available from within the Visual Studio development environment; it is available only when compiling from the command line.

请参阅See also