gcc编译参数

https://www.jianshu.com/p/223d8b6aa879

g++ test1.cpp -I/usr/local/include -L/usr/local/lib -lgtest -lpthread -o test1
-I/dir:在头文件搜索路径列表中添加 dir 目录
-L/dir:在-l选项库文件搜索路径列表中添加 dir 目录
-llibrary:连接名为library的库文件
-shared:生成一个共享目标文件,常搭配 -fPIC 使用

猜你喜欢

转载自blog.csdn.net/zxc995293774/article/details/83716891