Differences between revisions 3 and 4
Revision 3 as of 2011-08-03 11:01:06
Size: 1175
Editor: localhost
Comment: converted to 1.6 markup
Revision 4 as of 2012-08-14 14:45:32
Size: 1179
Editor: 182
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
[GNU] [Cee] / CeePlusPlus Compiler [[GNU]] [[Cee]] / [[C++]] Compiler
Line 8: Line 8:
 * In [KLDP]  * In [[KLDP]]
Line 41: Line 41:
[Debugging]은 주로 Moa:GDB 에서 한다. [[Debugging]]은 주로 Moa:GDB 에서 한다.

GnuCompilerCollection

GNU Cee / C++ Compiler

http://gcc.gnu.org

각종자료


일반적인 사용법

$ 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 에서 한다.


SeeAlso GCC, CeeCompiler


CategoryProgram

GCC (last edited 2013-02-14 13:45:41 by 61)

web biohackers.net