/Gk Compiler Option (C++, OS/2)

Syntax: Default:
/Gk[+|-] 
/Gk-

Use the /Gk option when you are linking object files created by versions of the compiler before VisualAge for C++ Version 3.0 that contain C++ templates. You must compile and link in one step (/C-, the default).

This option is valid only for C++ files.

If you compile and link old object files without the /Gk compiler option, the linker cannot resolve the templates in the old files, and stops linking.

When you specify /Gk, the compiler invokes the prelinker from version 2.1 to resolve the templates in old object files, and passes the /OLDCPP option to the linker, so that it continues linking when it encounters old object files that contain templates.

By default, the compiler lets the linker handle template resolution in C++ files.



Summary of Compiler Options