-
NTL build test intall in/usr/local
-
header files in /usr/local/include/NTL
-
compiled binary in /usr/local/lib/libntl.a【静态库】
-
【用户cpp文件在任意位置】g++ -g -O2 foo.cpp -o foo -lntl -lgmp -lm
-
【用户cpp在src文件夹里】make foo
#include 引号,preprocessor先找当前文件夹,再找编译器默认路径
#include 尖括号,preprocessor直接找默认路径
cpp -v .dev/null -o /dev/null
查看默认search路径
#include <...> search starts here:
/usr/lib/gcc/x86_64-linux-gnu/4.9/include
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu/4.9/include-fixed
/usr/include/x86_64-linux-gnu
/usr/include
-Idir, which causes dir to be searched after the current directory (for the quote form of the directive) and ahead of the standard system directories. You can specify multiple -I options on the command line, in which case the directories are searched in left-to-right order.
通过环境变量来改头文件搜索路径:http://www.network-theory.co.uk/docs/gccintro/gccintro_23.html
网友评论