Size: 1175
Comment:
|
Size: 1175
Comment: converted to 1.6 markup
|
No differences found! |
[GNU] [Cee] / CeePlusPlus Compiler
각종자료
- In [KLDP]
일반적인 사용법
$ gcc -g -Wall -ohello hello.c
옵션들
- -o : 출력파일명을 정한다.
- -c : 컴파일만한다. .o파일 생성
- -I : 헤더파일위치 지정. 보통은 ""을 기준으로한다. -Iinclude 하면 현재 디렉토리의 include디렉토리
- -l : 사용하는 라이브러리. libmylib.a 이면 -lmylib 이라고 쓴다.
- -L : 라이브러리의 위치
라이브러리만드는법
$ gcc -c myfunc.c $ ar r libmylib.a myfunc.o $ ar s libmylib.a $ ar t libmylib.a myfunc.o $ gcc -o say_linux hello.c -lmylib
64bit용으로 컴파일하기 옵션
CC=gcc CFLAGS="-O3 -m64 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3 -m64 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti"
[Debugging]은 주로 GDB 에서 한다.