clang Command Examples

Compiler for C, C++, and Objective-C source files. Can be used as a drop-in replacement for GCC. More information: https://clang.llvm.org/docs/ClangCommandLineReference.html.

clang {{input_source.c}} -o {{output_executable}}

clang {{input_source.c}} -Wall -o {{output_executable}}

clang {{input_source.c}} -o {{output_executable}} -I{{header_path}} -L{{library_path}} -l{{library_name}}

clang -S -emit-llvm {{file.c}} -o {{file.ll}}

clang -c {{input_source.c}}

clang {{path/to/source.c}} -O{{1|2|3|fast}}