Learning windows programming (3)-questions about hello. c

Source: Internet
Author: User
Tags microsoft c


In the previous article, we asked a few questions. This article is from hello. c's research will be conducted in various aspects. By the end of this article, we will see which of these questions can be answered. Of course, there are still some problems that may be solved later .......

Since we need to get rid of this problem, we need to start from the existing clues, add the searched knowledge, and think about ourselves. All problems are solved through this path (except for the boss, of course, the boss only needs to issue instructions and then get the results ......).

What we have now is a hello.c file, which can generate the target hello.exe file through the clcommand.

Then we can study cl.

CL description

Cl.exe(or cl.exe, it seems that windows file systems are not case sensitive? Let's directly reference Microsoft's statement.

CL.exe is a 32-bit tool that controls the Microsoft C and C ++ compilers and linker. the compilers produce Common Object File Format (COFF) object (. obj) files. the linker produces executable (.exe) files or dynamic-link libraries (DLLs ).

Note that all compiler options are case sensitive.

To compile without linking, use/c.

Because the VC6 version description is not found, the description text here is the CL. EXE description of Visual studio 2003, but they are all the same. From the above description, we can see that CL is used to control Microsoft C and C ++ compilers (compiler) and linker. Two things are done in total. The compiler will generate the target coffee file (.obj?; generate the executable file (.exe) or dynamic link library file (DLLs ).

In contrast to our previous practice, we generated a hello.objfile and a hello.exe file after executing the clcommand.

In addition, the link process can be skipped if the/c option is used.

CL Option

So what options does cl have? Use cl /? Let's take a look.

1 d: est> cl /? 2 Microsoft (R) 32-bit C/C ++ Optimizing Compiler Version 12.00.8168 for 80x86 3 Copyright (C) Microsoft Corp 1984-1998. all rights reserved. 4 5 C/C ++ compiler options 6 7-OPTIMIZATION-8 9/O1 minimize space/Op [-] improve floating-pt consistency10/O2 maximize speed/OS favor code space11/ oa assume no aliasing/Ot favor code speed12/Ob <n> inline expansion (default n = 0) /Ow assume cross-functi On aliasing13/Od disable optimizations (default)/Ox maximum opts. (/Ogityb1/Gs) 14/Og enable global optimization/Oy [-] enable frame pointer omission15/Oi enable intrinsic functions16 17-code generation-18 19/G3 optimize for 80386/Gy separate functions for linker20/G4 optimizefor 80486/Ge force stack checking for all funcs21/G5 optimize for Pentium/Gs [num] disable stack checking calls2 2/G6 optimize for Pentium Pro/Gh enable hook function call23/GB optimize for blended model (default) /GR [-] enable C ++ RTTI24/Gd _ cdecl calling convention/GX [-] enable C ++ EH (same as/ESCS) 25/Gr _ fastcall calling convention/Gi [-] enable incremental compilation26/Gz _ stdcall calling convention/Gm [-] enable minimal rebuild27/GA optimize for Windows Application/EHs enable synchronous C ++ EH28/GD optimize for Windows DLL/EHa enable asynchronous C ++ EH29 30/Gf enable string pooling/EHc extern "C" defaults to nothrow31/GF enable read-only string pooling /QIfdiv [-] enable Pentium FDIV fix32/GZ enable runtime debug checks/QI0f [-] enable Pentium 0x0f fix33 34-output files-35 36/Fa [file] name assembly listing file /Fo <file> name object file37/FA [SC] configure assembly listin G/Fp <file> name precompiled header file38/Fd [file] name. PDB file/Fr [file] name source browser file39/Fe <file> name executable file/FR [file] name extended. SBR file40/Fm [file] name map file41 42-PREPROCESSOR-43 44/C dont strip comments/FI <file> name forced include file45/D <name >{=|#} <text> define macro/U <name> remove predefined macro46/E preprocess to stdout/u remove all predefined ma Cros47/EP preprocess to stdout, no # line/I <dir> add to include search path48/P preprocess to file/X ignore "standard places" 49 50-LANGUAGE-51 52/Zi enable debugging information/Zl omit default library name in. OBJ53/ZI enable Edit and Continue debug info/Zg generate function prototypes54 55/Z7 enable old-style debug info/Zs syntax check only56/Zd line number debugging info only/vd {0 | 1} Disable/enable vtordisp57/Zp [n] pack structs on n-byte boundary/vm <x> type of pointers to members58/Za disable extensions (implies/Op) /noBool disable "bool" keyword59/Ze enable extensions (default) 60 61-MISCELLANEOUS-62 63 /?, /Help print this help message/V <string> set version string64/c compile only, no link/w disable all warnings65/H <num> max external name length/W <n> set warning level (default n = 1) 66/J default ch

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.