Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
battle_c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LEESANGKYEONG
battle_c
Commits
135fc234
Commit
135fc234
authored
4 years ago
by
LEESANGKYEONG
Browse files
Options
Downloads
Patches
Plain Diff
HW update
parent
81bd9e77
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
HW3/README.md
+18
-18
18 additions, 18 deletions
HW3/README.md
with
18 additions
and
18 deletions
HW3/README.md
+
18
−
18
View file @
135fc234
...
@@ -25,51 +25,51 @@
...
@@ -25,51 +25,51 @@
# GCC command
# GCC command
-
-E option: 전처리까지만 실행항 .i file 생성
-
-E option: 전처리까지만 실행항 .i file 생성
-
사용법: gcc -E
<filename>
.c >
<filename>
.i
-
사용법: gcc -E
<
""
filename
""
>
.c >
<
""
filename
""
>
.i
-
!
[
1
](
./image/1.PNG
)
-
!
[
1
](
./image/1.PNG
)
-
-S option: 어셈블리까지 실행하여 .s file 생성
-
-S option: 어셈블리까지 실행하여 .s file 생성
-
사용법: gcc -S
<filename>
.i
-
사용법: gcc -S
<
"
filename
"
>
.i
-
!
[
2
](
./image/2.PNG
)
-
!
[
2
](
./image/2.PNG
)
-
-c option: 전처리, 컴파일, 어셈블 실행하지만 링크는 안함 -> .o file 생성
-
-c option: 전처리, 컴파일, 어셈블 실행하지만 링크는 안함 -> .o file 생성
-
사용법: gcc -c
<filename>
.s
-
사용법: gcc -c
<
"
filename
"
>
.s
-
!
[
3
](
./image/3.PNG
)
-
!
[
3
](
./image/3.PNG
)
-
-g option: 운영체제 고유의 형식으로 디버깅 정보를 만듦
-
-g option: 운영체제 고유의 형식으로 디버깅 정보를 만듦
-
사용법: gcc- -g
<filename>
.c
-
사용법: gcc- -g
<
"
filename
"
>
.c
-
!
[
7
](
./image/7.
PNG
)
-
!
[
7
](
./image/7.
png
)
-
디버깅 정보를 추가하여 컴파일 하였기 때문에 용량이 더 큼
-
디버깅 정보를 추가하여 컴파일 하였기 때문에 용량이 더 큼
-
-o
<file>
option: 출력파일의 이름을 지정할 수 있음
-
-o
<
"
file
name
"
>
option: 출력파일의 이름을 지정할 수 있음
-
사용법: gcc -o
<filename>
01.option-E.c
-
사용법: gcc -o
<
"
filename
"
>
01.option-E.c
-
!
[
4
](
./image/4.PNG
)
-
!
[
4
](
./image/4.PNG
)
-
-I
<dir>
option: C source가 표준 디렉토리가 아닌 위치에 있는 헤더 파일을 가질 때, 해당 디렉토리 위치 지정해줌
-
-I
<
""
dir
""
>
option: C source가 표준 디렉토리가 아닌 위치에 있는 헤더 파일을 가질 때, 해당 디렉토리 위치 지정해줌
-
사용법: gcc
<filename>
.c -l
<dir>
-
사용법: gcc
<
"
filename
"
>
.c -l
<
"
dir
"
>
-
!
[
6
](
./image/6.PNG
)
-
!
[
6
](
./image/6.PNG
)
-
-l
<library
name
>
: 표준 라이브러리가 아닌 라이브러리를 사용하고 싶을 때, 해당 라이브러리 지정해줌
-
-l
<
"
libraryname
"
>
: 표준 라이브러리가 아닌 라이브러리를 사용하고 싶을 때, 해당 라이브러리 지정해줌
-
사용법: gcc
<filename>
.c -l
<libraryname>
-
사용법: gcc
<
"
filename
"
>
.c -l
<
"
libraryname
"
>
-
!
[
11
](
./image/11.PNG
)
-
!
[
11
](
./image/11.PNG
)
-
-L
<dir>
option: 사용자가 라이브러리를 직접 만들거나 새 라이브러리를 내려 받아 사용할 때, 해당 라이브러리 지정해줌
-
-L
<
"
dir
"
>
option: 사용자가 라이브러리를 직접 만들거나 새 라이브러리를 내려 받아 사용할 때, 해당 라이브러리 지정해줌
-
사용법: gcc -L
<library
directory
>
-
사용법: gcc -L
<
"
library
directory
"
>
-
-D
<macro>
option: #define MACRO를 선언 해준다.
-
-D
<
"
macro
"
>
option: #define MACRO를 선언 해준다.
-
사용법: gcc -D
<정의할
MACRO
이름
>
-
사용법: gcc -D
<정의할
MACRO
이름
>
-
!
[
8
](
./image/8.PNG
)
-
!
[
8
](
./image/8.PNG
)
-
#define NO를 -DNO로 선언함으로써 오류없이 컴파일됨
-
#define NO를 -DNO로 선언함으로써 오류없이 컴파일됨
-
-O
<level>
option: -O1, O2, O3의 세가지의 옵션이 존재하고 최소한의 스레드 분기 동작 횟수를 줄인다. 컴파일 시간은 증가하지만, 실행은 빨라짐
-
-O
<
"
level
"
>
option: -O1, O2, O3의 세가지의 옵션이 존재하고 최소한의 스레드 분기 동작 횟수를 줄인다. 컴파일 시간은 증가하지만, 실행은 빨라짐
-
사용법: gcc -O2
<filename>
.c
-
사용법: gcc -O2
<
"
filename
"
>
.c
-
-wall: gcc가 제공하는 모든 경고 메시지 출력
-
-wall: gcc가 제공하는 모든 경고 메시지 출력
-
사용법: gcc -Wall
<filename>
.c
-
사용법: gcc -Wall
<
"
filename
"
>
.c
-
!
[
10
](
./image/10.PNG
)
-
!
[
10
](
./image/10.PNG
)
-
-v option: 컴파일 과정과 version 출력
-
-v option: 컴파일 과정과 version 출력
-
사용법: gcc -v
<filename>
.c
-
사용법: gcc -v
<
"
filename
"
>
.c
-
!
[
9
](
./image/9.PNG
)
-
!
[
9
](
./image/9.PNG
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment