Sign in to follow this  
Boder

Getting the Best of the Microsoft Compiler

Recommended Posts

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

Share this post


Link to post
Share on other sites
It's the optimizing compiler they released in the toolkit from 2003.

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?

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this