Getting the Best of the Microsoft Compiler
I can't get the compiler to perform as well as the people who compiled the tutorial samples for a library I'm looking at. You can see the difference in size, and I want to understand how I can get the compiler to perform as well before I move on.
THEM: 35,840 B
ME: 55,808 B
Here are the options I am using for the commands:
cl -c -nologo -G7 -O2
link /MACHINE:X86
strip -s
It's the optimizing compiler they released in the toolkit from 2003.
The only library I'm linking to, besides the engine, is user32.lib and I just checked that they had to link to it because it uses a MessageBox.
Maybe I'm linking to libc and they are linking with MSCRT?
Quote:Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3052 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
The only library I'm linking to, besides the engine, is user32.lib and I just checked that they had to link to it because it uses a MessageBox.
Maybe I'm linking to libc and they are linking with MSCRT?
I can't find MSVCRT.lib anywhere, I checked the Platform SDK and the compiler lib/ folder. This might be it.
Is there an "ldd" equivalent for Windows so I can see what it's linked to?
Is there an "ldd" equivalent for Windows so I can see what it's linked to?
Quote:Original post by Boder
I can't get the compiler to perform as well as the people who compiled the tutorial samples for a library I'm looking at. You can see the difference in size, and I want to understand how I can get the compiler to perform as well before I move on.
THEM: 35,840 B
ME: 55,808 B
Here are the options I am using for the commands:
cl -c -nologo -G7 -O2
link /MACHINE:X86
strip -s
Make sure that you are targeting the same version of the standard lib - by default it statically links it in, but you can link to the dll(which will make your exe smaller).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement