完美解决编译缺少文件,apt-file search 命令去查找依赖。

1.序

在交叉编译过程中如果碰到少了什么头文件之类的报错,最好是使用 apt-file search 命令去查找依赖。

2.命令

比如: apt-file search /netlink/genl/genl.h

wpa_supplicant$ apt-file search /netlink/genl/genl.h
libnl-3-dev: /usr/include/libnl3/netlink/genl/genl.h
libnl-dev: /usr/include/netlink/genl/genl.h
wpa_supplicant$ apt-file search openssl/ssl.h
libssl-dev: /usr/include/openssl/ssl.h
eon@netview:~$ 
leon@netview:~$ apt-file search sys/prctl.h                
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LC_PAPER = "en_US.UTF-8",
        LC_ADDRESS = "en_US.UTF-8",
        LC_MONETARY = "en_US.UTF-8",
        LC_NUMERIC = "en_US.UTF-8",
        LC_TELEPHONE = "en_US.UTF-8",
        LC_IDENTIFICATION = "en_US.UTF-8",
        LC_MEASUREMENT = "en_US.UTF-8",
        LC_TIME = "en_US.UTF-8",
        LC_NAME = "en_US.UTF-8",
        LANG = "en_US"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
dietlibc-dev: /usr/include/diet/sys/prctl.h
emscripten: /usr/share/emscripten/system/include/libc/sys/prctl.h
gcc-arm-linux-androideabi: /usr/arm-linux-androideabi/include/sys/prctl.h
gcc-i686-linux-android: /usr/i686-linux-gnu/i686-linux-android/include/sys/prctl.h
libc6-dev: /usr/include/i386-linux-gnu/sys/prctl.h
libc6-dev-amd64: /usr/include/sys/prctl.h
libc6-dev-arm64-cross: /usr/aarch64-linux-gnu/include/sys/prctl.h
libc6-dev-armel-cross: /usr/arm-linux-gnueabi/include/sys/prctl.h
libc6-dev-armhf-cross: /usr/arm-linux-gnueabihf/include/sys/prctl.h
libc6-dev-powerpc-cross: /usr/powerpc-linux-gnu/include/sys/prctl.h
libc6-dev-ppc64el-cross: /usr/powerpc64le-linux-gnu/include/sys/prctl.h
libklibc-dev: /usr/lib/klibc/include/sys/prctl.h
musl-dev: /usr/include/i386-linux-musl/sys/prctl.h
leon@netview:~$ 
leon@netview:~$ 

你可能感兴趣的:(Linux,命令)