统信UOS通过源码安装软件提示“configure: error: cannot run C compiled programs.”错误
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遇到的两个问题解决,能够正常使用了。