美文网首页
关于NTL以及GCC搜索路径

关于NTL以及GCC搜索路径

作者: ifeelok | 来源:发表于2017-05-01 18:07 被阅读0次
    配置参数: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

    相关文章

      网友评论

          本文标题:关于NTL以及GCC搜索路径

          本文链接:https://www.haomeiwen.com/subject/uxcqtxtx.html