Makefile中 -I -L -l(转载)
1 |
gcc -o hello hello.c -I /home/hello/include -L /home/hello/lib -lworld |
上面这句表示在编译hello.c时:
1 2 3 |
-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表示在上面的lib的路径中寻找libworld.so动态库文件(如果gcc编译选项中加入了“-static”表示寻找libworld.a静态库文件) |
———————————————— 本文链接: https://turbock79.cn/?p=1258 原文链接:https://blog.csdn.net/h… 阅读更多 »Makefile中 -I -L -l(转载)