Linux command
ldc 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Compile D program
ldc2 [source.d]
Output executable name
ldc2 -of=[output] [source.d]
Compile with optimization
ldc2 -O2 [source.d]
Release build
ldc2 -release [source.d]
Debug build
ldc2 -g [source.d]
Compile only
ldc2 -c [source.d]
说明
ldc is the LLVM-based D compiler. It compiles D language source code to native executables. The compiler produces fast code using LLVM optimizations. It's one of the main D compilers alongside DMD.
参数
- -of _FILE_
- Output filename.
- -O _LEVEL_
- Optimization level.
- -release
- Disable runtime checks.
- -g
- Include debug info.
- -c
- Compile only, no link.
- --help
- Display help information.
FAQ
What is the ldc command used for?
ldc is the LLVM-based D compiler. It compiles D language source code to native executables. The compiler produces fast code using LLVM optimizations. It's one of the main D compilers alongside DMD.
How do I run a basic ldc example?
Run `ldc2 [source.d]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -of _FILE_ do in ldc?
Output filename.