Skip to content

Latest commit

 

History

History
82 lines (67 loc) · 2.85 KB

gy-enable-function-level-linking.md

File metadata and controls

82 lines (67 loc) · 2.85 KB
title ms.custom ms.date ms.prod ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic f1_keywords dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager translation.priority.ht
-Gy (Enable Function-Level Linking) | Microsoft Docs
11/04/2016
visual-studio-dev14
devlang-cpp
article
VC.Project.VCCLCompilerTool.EnableFunctionLevelLinking
/gy
VC.Project.VCCLWCECompilerTool.EnableFunctionLevelLinking
C++
enable function-level linking compiler option [C++]
COMDAT function
Gy compiler option [C++]
-Gy compiler option [C++]
/Gy compiler option [C++]
packaged functions
0d3cf14c-ed7d-4ad3-b4b6-104e56f61046
17
corob-msft
corob
ghogen
cs-cz
de-de
es-es
fr-fr
it-it
ja-jp
ko-kr
pl-pl
pt-br
ru-ru
tr-tr
zh-cn
zh-tw

/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

  1. Open the project's Property Pages dialog box. For details, see How to: Open Project Property Pages.

  2. Click the C/C++ folder.

  3. Click the Code Generation property page.

  4. Modify the Enable Function-Level Linking property.

To set this compiler option programmatically

  • See xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.EnableFunctionLevelLinking%2A.

See Also

Compiler Options
Setting Compiler Options