gcc compile options

1.环境变量

LD_LIBRARY_PATH=”/path/to/lib”: 寻找.so文件,对应于-lz等(小写的L)
LIBRARY_PATH
LDFLAGS=”-L/path/to/lib”,
C_INCLUDE_PATH=”-I/path/to/include”: 寻找.h文件,对应于代码中的#include<>
CFLAGS,
CPPFLAGS

2.编译中的符号

-L: 给定动态链接库的路径,给到.so文件所在的文件夹
-l(L的小写): 表示本次编译所需要的动态链接库
-Werror: 视警告为错误;出现任何警告即放弃编译.
-Wl,-rpath: 向ld传递-rpath参数,add a direcory to the runtime library search path. This is used when linking an ELF executable with shared objects. All -rpath arguments are concatenated and passed to the runtime linker, which uses them to locate shared objects at runtime.
-foption:
-fPIC: