---
title: 使用GCC for openEuler
description: "（这里以hello.c为例）"
url: https://www.hikunpeng.com/document/detail/zh/kunpengdevkithistory/hgcc/hist-hgcc/kunpenghgcc_06_0005.html
sourcePath: /source/zh/kunpengdevkithistory/hgcc/hist-hgcc/kunpenghgcc_06_0005.html
indexId: 468755392378deced2a84c4d6f3febd9d45cd02aec5baa7f41ab068a7fc8acbe71
---
# 使用GCC for openEuler

#### 编译运行C程序

（这里以hello.c为例）

hello.c代码

```
#include <stdio.h>
int main()
{
    printf("Hello, World!\n");
    return 0;
}
```


```
gcc hello.c -o hello.out
./hello.out
```


#### 编译运行Fortran程序

以下以hello.f90为例，其代码如下：

```
program main
    Implicit none
    write(*,*) "Hello World!"
    end program main
```


```
gfortran hello.f90 -o hello.out
./hello.out
```

GCC for openEuler基于开源GCC，其命令gcc、g++、gfortran等的使用方式与GCC相同。
