zoukankan      html  css  js  c++  java
  • Makefile一 头文件及库搜索路径

     头文件及库搜索路径

    头文件的搜索路径:

    头文件的搜索规则是:找到就使用,停止继续往下寻找

    1:  #include “mytest.h”

    搜索的顺序为:

      (1)先搜索当前目录

      (2)然后搜索编译时 -I 指定的目录

      (3)在搜索gcc的环境变量CPLUS_INCLUDE_PATH

      (4)最后搜索gcc内定的目录

      /usr/include

    [root@centos-64-min include]# ls /usr/include/
    aio.h ftw.h neteconet stab.h
    aliases.h _G_config.h netinet stdint.h
    alloca.h gconv.h netipx stdio_ext.h
    a.out.h getopt.h netiucv stdio.h
    argp.h glob.h netpacket stdlib.h
    argz.h gnu netrom string.h
    ar.h gnu-versions.h netrose strings.h
    arpa grp.h nfs sys
    asm gshadow.h nl_types.h syscall.h
    asm-generic iconv.h nss.h sysexits.h
    assert.h ieee754.h obstack.h syslog.h
    bits ifaddrs.h paths.h tar.h
    byteswap.h inttypes.h poll.h termio.h
    c++ langinfo.h printf.h termios.h
    complex.h lastlog.h protocols tgmath.h
    cpio.h libgen.h pthread.h thread_db.h
    crypt.h libintl.h pty.h time.h
    ctype.h libio.h pwd.h ttyent.h
    dirent.h limits.h python2.6 ucontext.h
    dlfcn.h link.h rdma ulimit.h
    drm linux re_comp.h unistd.h
    elf.h locale.h regex.h ustat.h
    endian.h malloc.h regexp.h utime.h
    envz.h math.h resolv.h utmp.h
    err.h mcheck.h rpc utmpx.h
    errno.h memory.h rpcsvc values.h
    error.h mntent.h sched.h video
    execinfo.h monetary.h scsi wait.h
    fcntl.h mqueue.h search.h wchar.h
    features.h mtd semaphore.h wctype.h
    fenv.h net setjmp.h wordexp.h
    fmtmsg.h netapi.h sgtty.h xen
    fnmatch.h netash shadow.h xlocale.h
    fpu_control.h netatalk signal.h
    fstab.h netax25 sound
    fts.h netdb.h spawn.h

      /usr/local/include

    当前该目录下没有文件

      /usr/lib/gcc/x86_64-redhat-linux/4.1.1/include

    [root@centos-64-min local]# ls /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/
    abmintrin.h float.h nmmintrin.h syslimits.h
    ammintrin.h fma4intrin.h omp.h tbmintrin.h
    avxintrin.h immintrin.h pmmintrin.h tmmintrin.h
    bmiintrin.h iso646.h popcntintrin.h unwind.h
    bmmintrin.h limits.h smmintrin.h varargs.h
    cpuid.h lwpintrin.h stdarg.h wmmintrin.h
    cross-stdarg.h mm3dnow.h stdbool.h x86intrin.h
    emmintrin.h mmintrin.h stddef.h xmmintrin.h
    f16cintrin.h mm_malloc.h stdfix.h xopintrin.h

    2:#include <stdio.h>

    搜索顺序为:

      (1)先搜索 -I 指定的目录

      (2)然后搜索gcc的环境变量CPLUS_INCLUDE_PATH

      (3)最后搜索gcc内定目录,上面三个

    待续...

  • 相关阅读:
    六十:权限提升-MY&MS&ORA等SQL数据库提权
    五十九:权限提升-Win溢出漏洞及AT&SC&PS提权
    五十八:权限提升-网站权限后台漏洞地第三方获取
    在kaili装git与git-lfs
    机器学习中的最优化算法总结
    动态规划及意义
    对于中变量与类的使用感想
    安装awvs教程参照
    kali乱码问题
    linux与Mac互相粘贴存在障碍,可以用这个命令联系起来
  • 原文地址:https://www.cnblogs.com/King-Penguin/p/5161910.html
Copyright © 2011-2022 走看看