If you use static binding, I suggest using linker linkers if you are compiling on the command line using the syntax:
cl / Ox [your source file (C ++)] [library required, if any] [required resource files, if any] / link / FILEALIGN: 512 / OPT: REF / OPT: ICF / INCREMENTAL: NO
If you build inside the Visual Studio IDE, you check the linker settings by choosing project properties from the menu. In the configuration, select Release and then click the linker settings found in the left pane, this will show you a list of configurations that match the linker’s default settings.
In the command line, under the linker, specify the / FILEALIGN: 512 option in the Advanced Options field and click the Apply button. In the General option under the linker, turn off incremental binding by selecting None (/ INCREMENTAL: NO). In the linker debugging option, select None to generate debugging information. To optimize the linker, you select "Exclude unnecessary data" (/ OPT: REF) in the links and "Delete redundant COMDAT" (/ OPT: ICF) in the "Enable COMDAT collapse" mode.
To optimize the compiler, make sure that the Release setting is selected, click on the C / C ++ tree in the left panel and select Optimization under it, select full optimization (/ Ox). In the "General" section of the "C / C ++" section, select "Disabled" for "Formatted Information Format".
Remember to click the "Apply" button for each change you make.
I hope that everything that I mentioned here would be useful for you, and all this applies to Visual C ++ 2005 and 2008, but I hope it also applies to Visual C ++ 2010, if not, kindly check the documentation included in your visual C ++ 2010 Installation.
NEL
source share