韌館-LearnHouse

Archive for 27 3 月, 2019

gcc 參數

## -c
只生成 obj 檔,並沒有產生執行檔。
例:gcc -c hello.c

## -o
生成執行檔,file name 沒指定時,預設檔名為 a.out。
例:gcc -o hello hello.c

## -llibrary
設定 link 時需便用的 library。
例:gcc -o hello -lhell hello.c,需要的 library 為 libhello.a。

## -Ldir
設定 link 時,查找 library 的路徑。
例:gcc -o hello -lhell -L. hello.c,會在源碼目錄內找尋 libhello.a 。

Read more...

2019年3 月 posted by admin in 程式&軟體 and have No Comments