当前位置:首页 > Linux > 正文内容

解决交叉编译arm-linux-gnueabihf/bin/ld: cannot find -*** 的类似报错

chanra1n2周前 (04-14)Linux95

交叉编译报错:

/usr/lib/gcc-cross/arm-linux-gnueabihf/7/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lpcre
/usr/lib/gcc-cross/arm-linux-gnueabihf/7/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lnettle
/usr/lib/gcc-cross/arm-linux-gnueabihf/7/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lgnutls

类似这样的,问题是缺少交叉编译的依赖库(libpcre、libnettle、libgnutls)

解决方法:

wget https://sourceforge.net/projects/pcre/files/pcre2/10.37/pcre2-10.37.tar.gz
tar -xzvf pcre2-10.37.tar.gz
cd  pcre2-10.37/
./configure --host=arm-linux-gnueabihf \
            --prefix=$HOME/arm-libs \
            --disable-shared \
            --enable-static
make -j$(nproc)
make install
cd ..

wget https://ftp.gnu.org/gnu/nettle/nettle-3.6.tar.gz
tar -xzvf nettle-3.6.tar.gz
cd nettle-3.6

./configure --host=arm-linux-gnueabihf \
            --prefix=$HOME/arm-libs \
            --enable-shared \
            --enable-static \
            --enable-mini-gmp

make -j$(nproc)
make install
cd ..

wget https://gmplib.org/download/gmp/gmp-6.3.0.tar.xz
tar -xvf gmp-6.3.0.tar.xz
cd gmp-6.3.0

# 配置为 ARM 交叉编译
./configure --host=arm-linux-gnueabihf \
            --prefix=$HOME/arm-libs \
            --disable-shared \
            --enable-static

make -j$(nproc)
make install
cd ..

wget https://www.gnupg.org/ftp/gcrypt/gnutls/v3.8/gnutls-3.8.0.tar.xz
tar -xvf gnutls-3.8.0.tar.xz
cd gnutls-3.8.0

export PKG_CONFIG_PATH=$HOME/arm-libs/lib/pkgconfig
export PKG_CONFIG_LIBDIR=$HOME/arm-libs/lib


# 配置时需指定依赖库路径
./configure --host=arm-linux-gnueabihf \
            --prefix=$HOME/arm-libs \
            --disable-shared \
            --enable-static \
            --with-included-libtasn1 \
            --with-included-unistring \
            --without-p11-kit \
            CPPFLAGS="-I$HOME/arm-libs/include" \
            LDFLAGS="-L$HOME/arm-libs/lib"

make -j$(nproc)
make install
cd ..

然后重新make就可以解决问题


扫描二维码推送至手机访问。

版权声明:本文由我的FPGA发布,如需转载请注明出处。

本文链接:https://world.myfpga.cn/index.php/post/443.html

分享给朋友:

“解决交叉编译arm-linux-gnueabihf/bin/ld: cannot find -*** 的类似报错” 的相关文章

有效部署阿里云DDNS+Python环境

有效部署阿里云DDNS+Python环境

第一步复制以下代码并生成api,代码转自CSDN,并经过优化修改请将代码保存为1.sh 然后使用sodu su 1.sh 运行代码,输入1后按回车键等待安装完成echo "请输入序号选择你要干啥:   输入1. 升级到Python 2.7...

一键升级Centos6 Python至2.7.9 并安装宝塔

一键升级Centos6 Python至2.7.9 并安装宝塔

#直接复制运行命令即可 curl -o install.sh http://download.myfpga.cn/linux/centos/pythonandbt.sh && sh install.sh...

Gi945/Fi945 BIOS 终极修改版 V1.6.7

Gi945/Fi945 BIOS 终极修改版 V1.6.7

点击直接下载:GI945.BIN另外附上原版有锁BIOSgi945有锁版.bin...

MW155R AR9331 刷机固件合集

MW155R AR9331 刷机固件合集

factory-to-ddwrt.binddwifi-ar71xx-generic-tl-wr710n-v1-squashfs-sysupgrade.binGECOOS_AP110T_QCA933X_5.6_2018102600.binlede-17.01.0-r3205-59508e3-ar71x...

iKuai-小白-1.3.4 16M固件

iKuai-小白-1.3.4 16M固件

iKuai-小白-1.3.4 16M编辑器备份固件.bin...

MW788刷NR285G固件

MW788刷NR285G固件

netcore(NR285G).zip...