Enabling Function-Level Linking (/Gy)

The /Gy option enables linking on a function-by-function basis. When function-level linking is enabled, the linker removes unreferenced functions from the executable file, making your program significantly smaller. See Chapter 13, “CL Command Reference,” of the Environment and Tools manual for more information.

C++ member functions are always compiled with function-level linking enabled. Use the /Gy option for nonmember functions in C++ and all functions in C.