关于NTL以及GCC搜索路径

配置参数:anjuta使用NTL.png
  1. NTL build test intall in/usr/local

  2. header files in /usr/local/include/NTL

  3. 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
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容