Linux 编译错误以及解决方案集锦

1.在linux中编译一个应用出现了以下错误: “fatal error: openssl/aes.h: No such file or directory”.

出现这个原因是因为linux系统中缺少openssl相应的文件。
To fix this problem, you have to install OpenSSL development package, which is available in standard repositories of all modern Linux distributions.
To install OpenSSL development package on Debian, Ubuntu or their derivatives:

$ sudo apt-get install libssl-dev

To install OpenSSL development package on Fedora, CentOS or RHEL:

$ sudo yum install openssl-devel

After installing the package, try recompiling the program.

2.unrecognized option ‘-Wl,-O1’

在编译kernel的时候出现如下错误

  CHK     scripts/mod/devicetable-offsets.h
  CHK     include/generated/compile.h
  LD [M]  arch/arm64/crypto/crct10dif-ce.o
aarch64-poky-linux-ld: unrecognized option '-Wl,-O1'
aarch64-poky-linux-ld: use the --help option for usage information
scripts/Makefile.build:572: recipe for target 'arch/arm64/crypto/crct10dif-ce.o' failed
make[1]: *** [arch/arm64/crypto/crct10dif-ce.o] Error 1
Makefile:1039: recipe for target 'arch/arm64/crypto' failed
make: *** [arch/arm64/crypto] Error 2

需要用在编译前,输入以下参数设置:

$ unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE

3.NXP LINUX Yocto 环境下载出错

$ repo init -u git://git.freescale.com/imx/fsl-arm-yocto-bsp.git -b imx-4.1.15-1.0.0_ga
repo: warning: Python 2 is no longer supported; Please upgrade to Python 3.6+.
repo: warning: Python 2 is no longer supported; Please upgrade to Python 3.6+.
manifests:
fatal: unable to connect to git.freescale.com:
git.freescale.com: Name or service not known

因为原来地址已变迁需要将"“git://git.freescale.com/imx” " 改成 “https://source.codeaurora.org/external/imx”

$ repo init -u https://source.codeaurora.org/external/imx/fsl-arm-yocto-bsp.git -b imx-4.1.15-1.0.0_ga

4.NXP LINUX Yocto 编译错误

在编译Yocto 环境的时候出现如下错误

WARNING: cronie-1.5.0-r0 do_fetch: Checksum mismatch for local file linux/linux-4.1.15/fsl-release-bsp/downloads/cronie-1.5.0.tar.gz
Cleaning and trying again.
WARNING: cronie-1.5.0-r0 do_fetch: Renaming linux/linux-4.1.15/fsl-release-bsp/downloads/cronie-1.5.0.tar.gz to linux/linux-4.1.15/fsl-release-bsp/downloads/cronie-1.5.0.tar.gz_bad-checksum_5d16475774312b752fbcaf5e8faacc3c
WARNING: cronie-1.5.0-r0 do_fetch: Checksum failure encountered with download of https://fedorahosted.org/releases/c/r/cronie/cronie-1.5.0.tar.gz - will attempt other sources if available
WARNING: firmware-imx-1_5.4-r0 do_fetch: Failed to fetch URL git://git.freescale.com/imx/imx-firmware.git;branch=master;destsuffix=linux/linux-4.1.15/fsl-release-bsp/build-x11/tmp/work/cortexa9hf-neon-mx6qdl-poky-linux-gnueabi/firmware-imx/1_5.4-r0/firmware-imx-5.4/git, attempting MIRRORS if available
ERROR: firmware-imx-1_5.4-r0 do_fetch: Fetcher failure: Fetch command failed with exit code 128, output:
Cloning into bare repository 'linux/linux-4.1.15/fsl-release-bsp/downloads//git2/git.freescale.com.imx.imx-firmware.git'...
fatal: unable to connect to git.freescale.com:
git.freescale.com: Name or service not known


ERROR: firmware-imx-1_5.4-r0 do_fetch: Function failed: Fetcher failure for URL: 'git://git.freescale.com/imx/imx-firmware.git;branch=master;destsuffix=linux/linux-4.1.15/fsl-release-bsp/build-x11/tmp/work/cortexa9hf-neon-mx6qdl-poky-linux-gnueabi/firmware-imx/1_5.4-r0/firmware-imx-5.4/git'. Unable to fetch URL from any source.
ERROR: Logfile of failure stored in: linux/linux-4.1.15/fsl-release-bsp/build-x11/tmp/work/cortexa9hf-neon-mx6qdl-poky-linux-gnueabi/firmware-imx/1_5.4-r0/temp/log.do_fetch.12886
ERROR: Task 1331 (linux/linux-4.1.15/fsl-release-bsp/sources/meta-fsl-bsp-release/imx/meta-bsp/recipes-bsp/firmware-imx/firmware-imx_5.4.bb, do_fetch) failed with exit code '1'
NOTE: Tasks Summary: Attempted 2077 tasks of which 0 didn't need to be rerun and 1 failed.
Waiting for 0 running tasks to finish:

Summary: 1 task failed:
  linux/linux-4.1.15/fsl-release-bsp/sources/meta-fsl-bsp-release/imx/meta-bsp/recipes-bsp/firmware-imx/firmware-imx_5.4.bb, do_fetch
Summary: There were 50 WARNING messages shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

The following link can solve this problem;
https://community.nxp.com/docs/DOC-346089

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值