configure: error: C++ compiler cannot create executables/checking for arm-linux-gnueabihf-strip.. no

一、问题描述

在linux虚拟机中用./configure xxxxxx交叉编译触摸源码(tslib-1.4.tar.gz)的时候遇到无法编译出Makefile并且报错configure: error: C++ compiler cannot create executables以及checking for arm-linux-gnueabihf-strip... no的问题

完整报错信息

关键是这句问题checking for arm-linux-gnueabihf-strip... no

说明系统找不到交叉编译工具arm-linux-gnueabihf

二、解决方法

(在root用户下)

1.确认安装了以下包:

apt-get install autoconf
apt-get install automake
apt-get install libtool
apt-get install pkg-config
apt-get install m4

2.确保已经配置对应版本的交叉编译工具

在终端输入指令 :  arm-linux-gnueabihf-gcc -v   查看交叉编译工具版本信息

3.将交叉编译工具arm-linux-gnueabihf所有文件的路径给加到PATH中

指令:
export PATH=$PATH:/你安装交叉编译工具的目录/arm-linux-4.9.4-x86_64/bin

例如:我安装在了Computer/opt  内(可直接cd /opt )


 

           指令为:   export PATH=$PATH:/opt/arm-linux-4.9.4-x86_64/bin
注意:1.此句命令运行后仅在当前终端生效,更换或新建新的终端需重新输入。

           2.不同用户级别也不可共享使用,如用root用户下运行的该指令,arm-linux-gnueabihf指令也只可在root用户下使用


此时arm-linux-gnueabihf-gcc 就可以作为指令被识别

然后更新环境配置,指令: source .bashrc

4.编译完成

之后再次使用   ./configure xxxxxx   指令对文件进行编译

例如:

./configure --prefix=/opt/tslib1.4 CC= arm-linux-gnueabihf -gcc CXX= arm-linux-gnueabihf -g++
--host= arm-linux-gnueabihf
(长指令在某些情况下需完全手打,请勿直接复制运行)
也可尝试将红字替换为交叉编译工具文件的对应路径以解决该问题
例如:/你的路径/arm-linux-4.9.4-x86_64/bin/arm-linux-gnueabihf-gcc(g++)

成功编译出makefile则编译成功

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值