linux下使用g++/gcc编译程序时,-I、-L、-l 的区别

2021年01月21日 周四 天气晴 【不悲叹过去,不荒废现在,不惧怕未来】


-I (大写i):-I 后跟头文件目录,如-I ./lib/openssl/include。

-L(大写L):-L 后跟库文件目录,库文件为静态库.a或动态库.so文件,如 -L ./lib/sqlite。

-l (小写L):-I 后跟动态库名字,如果是静态库,要加上“-static”。


参考文献

https://blog.csdn.net/TMD_MCU/article/details/77540504?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-2.not_use_machine_learn_pai&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-2.not_use_machine_learn_pai

猜你喜欢

转载自blog.csdn.net/m0_37433111/article/details/112919923