非系统默认路径下的编译、链接、运行事宜

Need to understand these things
以下只罗列目前已知的几种方式,仍需要透彻地学习理解(编译器searching的过程,各个环境变量的作用)
编译时指定

CC -Iinclude_dir -Llib_dir xxx.c -o xxx
CC -Iinclude_dir -Llib_dir xxx.c -lsome_lib -o xxx    (有时需要指定要链接的库,如 -lcaffe)

加入环境变量中

LD_LIBRARY_PATH
LIBRARY_PATH
C_INCLUDE_PATH
CPLUS_INCLUDE_PATH

posted on 2017-07-04 20:18  westwindrest  阅读(216)  评论(0编辑  收藏  举报