---
title: 使用毕昇编译器
description: "执行以下命令编译运行C程序，其中“command line flags”为编译选项，具体可参考毕昇编译器选项说明章节。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengdevkithistory/bisheng/hist-bisheng/kunpengbisheng_06_0006.html
sourcePath: /source/zh/kunpengdevkithistory/bisheng/hist-bisheng/kunpengbisheng_06_0006.html
indexId: e1e0a0ebccfadd40801b5fbe096763121d36e02f6dcb5a11e36deecb49ffa51d80
---
# 使用毕昇编译器

#### 编译运行C/C++程序

执行以下命令编译运行C程序，其中“command line flags”为编译选项，具体可参考毕昇编译器选项说明章节。

```
clang  [command line flags]  hello.c  -o  hello.o 
./hello.o
```

执行以下命令编译运行C++程序，其中“command line flags”为编译选项，具体可参考毕昇编译器选项说明章节。

```
clang++  [command line flags]  hello.cpp  -o  hello.o 
./hello.o
```


#### 编译运行Fortran程序

执行以下命令编译运行Fortran程序，其中“command line flags”为编译选项，具体可参考毕昇编译器选项说明章节。

```
flang  [command line flags]  hello.f90  -o  hello.o 
./hello.o
```


#### 指定链接器

毕昇编译器指定的链接器是LLVM的lld，若不指定它则使用默认的ld。其中“command line flags”为编译选项，具体可参考毕昇编译器选项说明章节。

```
clang  [command line flags]  -fuse-ld=lld  hello.c  -o  hello.o 
./hello.o
```
