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

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

chanra1n4周前 (04-14)Linux163

交叉编译报错:

/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://myfpga.cn/index.php/post/443.html

分享给朋友:

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

CentOS7 安装Caddy、Aria2、AriaNg实现离线下载

CentOS7 安装Caddy、Aria2、AriaNg实现离线下载

#CentOS执行以下命令yum -y install wget unzip curl wget https://github.com/helloxz/ccaa/archive/master.zip unzip master....

Ubuntu或Debian 安装Kali工具集

Ubuntu或Debian 安装Kali工具集

sudo su git clone https://github.com/LionSec/katoolin.git && cp katoolin/katoolin.py /usr/bin/katoolin ch...

一键升级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...

强大的视频格式转换工具 FFmpeg的安装

强大的视频格式转换工具 FFmpeg的安装

kali环境下的安装sudo apt-get install ffmpeg -y && ffmpeg -versionUbuntu环境下的安装sudo apt install ffmp...

爱快登录面板API

爱快登录面板API

接口名:登录面板API接口地址:路由器管理地址+/Action/login接口调用方式:POST参数1:username    用户名参数2:passwd    密码,为输入密码的MD5加密,32位小写参数3:pass&...

NW788 MW788改NR285G教程及工具 附带CH341A 1.26版本 支持OTP写入 亲测改285成功

NW788 MW788改NR285G教程及工具 附带CH341A 1.26版本 支持OTP写入 亲测改285成功

285g读取1.bin支持(OTP分区)CH341A编程器1.26.rar原作者开发软件不容易,大家尽量购买正版设备,编程器软件烧写285固件的时候需要在选项里面选择主存储和OTP分区一块烧写淘宝买的1606E加密芯片(卖家坑爹,买了10个,发来有5个是MX258XX)看在包邮份上就不计较了存储芯片...