mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-03-07 02:57:04 +00:00
Update cheatsheets
This commit is contained in:
37
tldr/windows/cl
Normal file
37
tldr/windows/cl
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# cl
|
||||
|
||||
> The Microsoft C/C++ compiler for compiling and linking source code files.
|
||||
> More information: <https://learn.microsoft.com/cpp/build/reference/compiler-command-line-syntax>.
|
||||
|
||||
- Compile a source file:
|
||||
|
||||
`cl {{path/to/source.c}}`
|
||||
|
||||
- Compile and create an executable with a custom name:
|
||||
|
||||
`cl /Fe {{path/to/output_executable}} {{path/to/source.c}}`
|
||||
|
||||
- Compile a source file with optimization enabled:
|
||||
|
||||
`cl /O2 {{path/to/source.c}}`
|
||||
|
||||
- Compile a source file and create a debug executable:
|
||||
|
||||
`cl /Zi {{path/to/source.c}}`
|
||||
|
||||
- Compile multiple source files:
|
||||
|
||||
`cl {{path/to/source1.c path/to/source2.c ...}}`
|
||||
|
||||
- Specify the output directory for compiled files:
|
||||
|
||||
`cl /Fo {{path/to/output_directory/}} {{path/to/source.c}}`
|
||||
|
||||
- Compile with warnings as errors:
|
||||
|
||||
`cl /WX {{path/to/source.c}}`
|
||||
Reference in New Issue
Block a user