티스토리 뷰

Development/Unix and Linux

gcc (GNU C Compiler)

궁선이 2018. 4. 6. 03:58

gcc [options] sourcefile

헤더 및 라이브러리 표준 경로
헤더파일 : /usr/include
정적 라이브러리 파일 : /usr/lib, /lib

컴파일 과정
a.c -> 전처리기 -> a.i -> 어셈블러 -> a.s -> 컴파일러 -> a.o -> 링커 -> a.out

컴파일 중단 옵션
-E : 전처리까지 (.i)
-S : 어셈블리 생성까지 (.s)
-c : 컴파일까지 (.o)

기타 옵션
-D name [= value ] : define a symbol name
-g : debug 정보 포함
-I  pathname : add pathname for #include files
-L directory : add directory for library directories
-l library : link with library
-o outputfile : name the output file outputfile
-O[level] : optimize the object code
-Wall : 아주 사소한 모호성도 경고를 보낸다.



'Development > Unix and Linux' 카테고리의 다른 글

터미널 명령어 - ps  (0) 2018.04.06
Emacs 명령어  (0) 2018.04.06
터미널 명령어 - uname  (0) 2018.04.06
패턴 정규 표현식  (0) 2018.04.06
터미널 명령어 - grep  (0) 2018.04.06
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/07   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
글 보관함