GCC

원래 C 언어용 컴파일러로 시작하여 GNU C Compiler의 약자였다.

2.9 버전에 이르러 C 언어뿐 아니라 Objective C, 파스칼, 에이다 같은 언어를 지원하게 되면서 GNU Compiler Collection 으로 변경되었다.

등 의 많은 최적화를 수행하는 Compiler 이다. IDE 를 가지고 있지 않은 Command Line Compiler 이다.

Installing GCC on Mac OS X

터미널에서

❯ gcc --version 혹은 ❯ gcc --v

입력 시 아래처럼 나온다. 보통 설치되어 있다. 설치되어 있지 않다면 설치하라고 말해줄 것이다.

Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: x86_64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

More details can be obtained via -v option, for example,

Getting Started

간단한 Hello-world C program hello.c 을 만들어보자.

#include <stdio.h>

int main() {
        printf("Hello, world! \\n");
        return 0;
}