CentOS Stream 8にgccをインストールする

1.開発ツールパッケージをインストール

# sudo dnf group install "Development Tools"

2.バージョンを確認

# gcc --version
gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-3)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

3.テストプログラム
# vi test.c
サンプルコード

#include <stdio.h>
int main()
{
printf("test message\n");
return 0;
}

コンパイルを行う
# gcc test.c -o test

# ./test
test message

CentOS Stream 8

Posted by arkgame