解决cannot run test program错误
来源:互联网 发布:360安全软件管家 编辑:程序博客网 时间:2024/06/10 01:23
在交叉编译的时候总是使用 :
./configure --prefix=/home/install --build=i686 --target=arm-linux --host=arm-linux
//等相应交叉编译选项
但是在CONFIGURE中有很多的测试程序是不可以在HOST上运行的就会出现:
……
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for doxygen... /usr/bin/doxygen
checking sys/inotify.h usability... yes
checking sys/inotify.h presence... yes
checking for sys/inotify.h... yes
checking mcheck.h usability... yes
checking mcheck.h presence... yes
checking for mcheck.h... yes
checking whether sys/inotify.h actually works... configure: error: cannot run test program while cross compiling
See `config.log' for more details.
1、记下出错的地方“checking whether sys/inotify.h”
2、去config.log查看相应的错误详解(我查看config.log没有什么很好的收获,又因为这程序在我的linux系统下可以正常编译通过,只是在交叉编译时出问题,确定为测试程序在HOST上不可运行)
3、查看configure文件发现出错的测试代码:
……
{ echo "$as_me:$LINENO: checking whether sys/inotify.h actually works" >&5
echo $ECHO_N "checking whether sys/inotify.h actually works... $ECHO_C" >&6; }
if test "$cross_compiling" = yes; then
{ { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See /`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See /`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
……
这里可以直接把then部分删除,把else改为then(就是直接去掉测试部分)
对于有其他内容的测试可通过创建cachefile解决(视具体情况而定)
下面给出创建cachefile的例子:
实际错误:error: cannot run test program while cross compiling
configure文件中的相应代码部分:
……
echo "$as_me:$LINENO: checking abstract socket namespace" >&5
echo $ECHO_N "checking abstract socket namespace... $ECHO_C" >&6
if test "${ac_cv_have_abstract_sockets+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
……
//其中ac_cv_have_abstract_sockets是我们要查找的变量
解决方法:
#echo ac_cv_have_abstract_sockets=yes > mips-linux.cache
/*第二个实例摘自网络*/
- 解决cannot run test program错误
- Cannot run program "jad" 的错误
- Failed to get the adb version: Cannot run program "D:\..."的错误解决!
- 解决错误 'Cannot run program "/home/***/android-sdk-linux/platform-tools/adb": error=2
- [转] error: cannot run test program while cross compiling
- Cross compile problem: cannot run test program while cross compiling
- JSPF 编译错误 Cannot run program "javadoc.exe"
- Cannot run program “protoc” Hadoop 3.0 编译错误
- Ant build编译错误 Cannot run program "javadoc.exe"
- AndroidStudio出现Cannot run program "/usr/local/bin/git"错误
- 解决IDEA的"Cannot run program "git.exe": CreateProcess error=2, 系统找不到指定的文件"错误
- Cannot run program "python"问题解决
- java.io.IOException: Cannot run program "ls": CreateProcess error=2,错误解决方法
- 【hadoop错误】Cannot run program "chmod": CreateProcess error=2 异常
- android常见错误之“Failed to get the adb version: Cannot run program”
- PhpStorm中报 “Cannot run program git.exe, 系统找不到指定的文件” 错误的解决方法
- hudson运行出现java.io.IOException Cannot run program的错误分析
- 解决 Cannot run program "/home/zhengyx/git/jymall-android-master/${aapt}"
- dbus接口
- 老婆的使用说明书
- C++ 一些陷阱
- 定制安装 ubuntu
- SQL Databases Don't Scale (简译)
- 解决cannot run test program错误
- 用情境搜索开启未来之路
- Mysql的日期和时间函数
- GRUB在Windows分区中引导linux
- Google API介绍(转)
- 如果你喜欢编程 给想做程序员的人的7个建议
- 关于隐式转换
- (转)在VC6.0下创建自己的C函数库 收藏
- Fedora KVM Bridge 备忘