统信UOS通过源码安装软件提示“configure: error: cannot run C compiled programs.”错误

本文讲述了在安装Git时遇到的两个问题:一是编译时的C程序运行错误,通过添加--host参数解决;二是iconv测试程序无法运行,需调整系统安全设置。最终解决了安装问题并能正常使用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. 问题说明

使用源码的方式安装git软件,安装过程中出现两个错误。

  • 编译错误“cannot run C compiled programs”
XC:~/Downloads/git-2.42.1$ ./configure --prefix=/home/software/git-2.42.1
configure: Setting lib to 'lib' (the default)
configure: Will try -pthread then -lpthread to enable POSIX Threads.
configure: CHECKS for site configuration
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... configure: error: in `/home/Downloads/git-2.42.1':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
  • 无法安装错误
checking whether iconv omits bom for utf-16 and utf-32... configure: error: in `/home/Downloads/git-2.42.1':
configure: error: cannot run test program while cross compiling

2. 问题解决

  • 解决第1个错误的解决方式,在后边增加–host参数再次进行编译,编译成功。
./configure --prefix=/home/software/git-2.42.1 --host=arm
  • 解决第2个问题,需要打开系统的“安全中心-安全工具-应用安全”,将仅允许签名应用调整为允许任意应用,然后再次尝试安装即可安装成功
    在这里插入图片描述

至此安装git遇到的两个问题解决,能够正常使用了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

科技早茶铺

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值