/Gy (Enable Function-Level Linking)
Allows the compiler to package individual functions in the form of packaged functions (COMDATs).
Syntax
/Gy[-]
Remarks
The linker requires that functions be packaged separately as COMDATs to exclude or order individual functions in a DLL or .exe file.
You can use the linker option /OPT (Optimizations) to exclude unreferenced packaged functions from the .exe file.
You can use the linker option /ORDER (Put Functions in Order) to include packaged functions in a specified order in the .exe file.
Inline functions are always packaged if they are instantiated as calls (which occurs, for example, if inlining is off or you take a function address). In addition, C++ member functions defined in the class declaration are automatically packaged; other functions are not, and selecting this option is required to compile them as packaged functions.
Note
The /ZI option, used for Edit and Continue, automatically sets the /Gy option.
To set this compiler option in the Visual Studio development environment
Open the project's Property Pages dialog box. For details, see Set C++ compiler and build properties in Visual Studio.
Select the Configuration Properties > C/C++ > Code Generation property page.
Modify the Enable Function-Level Linking property.
To set this compiler option programmatically
See also
Phản hồi
https://aka.ms/ContentUserFeedback.
Sắp ra mắt: Trong năm 2024, chúng tôi sẽ dần gỡ bỏ Sự cố với GitHub dưới dạng cơ chế phản hồi cho nội dung và thay thế bằng hệ thống phản hồi mới. Để biết thêm thông tin, hãy xem:Gửi và xem ý kiến phản hồi dành cho