gcc (2) 썸네일형 리스트형 [C/C++] 헤더 파일은 어디서 소스를 가져올까? 0. 개요 Linux 환경에서 커널을 살펴보거나 C 프로그래밍을 하다 보면 의문점이 생긴다. #include #include "myheader.h" 위와 같이 소스코드 맨 위에서 #include를 통한 헤더파일 삽입 전처리기를 사용하는데, 는 컴파일러가 정해놓은 루트(리눅스에선 일반적으로 /usr/include/)에서 찾고, ""는 현재 폴더에서 찾는다는 사실! ...까지는 많은 사람이 알고있다. 그런데 막상 그 헤더파일을 까보면 1) 각종 매크로 2) 구조체 3) 함수 선언부 4) 인라인 함수 5) 주석만 잔뜩 존재하고 3) 에서 선언된 함수의 소스는 찾을 수가 없다. 컴파일 구조를 생각했을 때, 우리가 작성한 main.c 파일 등에서 include한 것은 .o(오브젝트) 파일일 때에는 링크할 공간만 .. gcc, objdump 기본 명령어 gcc : 오픈소스 컴파일러의 일종 아래는 gcc --help의 내용 Options: -pass-exit-codes Exit with highest error code from a phase. --help Display this information. --target-help Display target specific command line options. --help={common|optimizers|params|target|warnings|[^]{joined|separate|undocumented}}[,...]. Display specific types of command line options. (Use '-v --help' to display command line options of sub-pr.. 이전 1 다음