Linking Objects Built with the /Gt Switch

If you use CL both to compile and to link, then /Gt32 enables the optimal use of the GP register for most applications. However, if you link separately by using LINK, then the /Gt option must also be passed to the linker by using the /gpsize:n option. To preserve the effects of /Gt32, specify /gpsize:32 on the linker’s command line.

When developing and debugging your application, it is a good idea to use the incremental linking feature of Visual C++. When building your release product, however, disable incremental linking to increase performance.