gcc -o hello hello.c -I /home/hello/include -L /home/hello/lib -lworld
上面這句表示在編譯hello.c時:
-I /home/hello/include
表示將/home/hello/include目錄作為第一個尋找頭文件的目錄,尋找的順序是:/home/hello/include–>/usr/include–>/usr/local/include
-L /home/hello/lib
表示將/home/hello/lib目錄作為第一個尋找庫文件的目錄,尋找的順序是:/home/hello/lib–>/lib–>/usr/lib–>/usr/local/lib
-lworld