Cygwin下用crosstool-ng 编译交叉工具链的常见错误及解决办法.docx_第1页
Cygwin下用crosstool-ng 编译交叉工具链的常见错误及解决办法.docx_第2页
Cygwin下用crosstool-ng 编译交叉工具链的常见错误及解决办法.docx_第3页
Cygwin下用crosstool-ng 编译交叉工具链的常见错误及解决办法.docx_第4页
Cygwin下用crosstool-ng 编译交叉工具链的常见错误及解决办法.docx_第5页
已阅读5页,还剩7页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Cygwin下用crosstool-ng 编译交叉工具链的常见错误及解决办法2011-02-28 21:221、配置crosstool-ng产生的错误1.1 ncurses headers files were not foundChecking for ncurses/ncurses.h. noChecking for ncurses/curses.h. noChecking for ncurses.h. noChecking for curses.h. noncurses headers files were not found解决方法:安装:ncurses,、libncurses-devel1.2 flex none foundChecking for flex. Noflex: none foundEither you are missing entirely the needed tool,or the version you have is too old.configure: Bailing out.解决方法:安装:flex,flexdll1.3 automake 1.10 or above was not foundChecking for automake. noautomake 1.10 or above was not foundEither you are missing entirely the needed tool,or the version you have is too old.configure: Bailing out.解决方法:安装:automake1.4 libtool 1.5.26 or above was not foundChecking for libtool. nolibtool 1.5.26 or above was not foundEither you are missing entirely the needed tool,or the version you have is too old.You can give the path to this tool using: -with-libtool=PATHconfigure: Bailing out.解决方法:安装:libtool注:在配置crosstool-NG时,出现的类似“XXX:none found”的错误,都可以是该工具没有安装,把该工具安装上,重新配置即可。1.5 ct-ng help命令检查时出错crosstool-ng 安装成功后,用ct-ng help命令检查时,不认识该命令这多半是添加环境变量失败造成的,这时可以打开/home/Administrator目录下的.bashrc查看是否把windows里的其他环境变量添加到了.bashrc文件中,如果把多余的去掉,只保留cgywin自己的环境变量,如下所示:PATH=/usr/local/bin:/usr/bin:/bin:/opt/crosstool-ng-1.9.3/bin1.6 配置时的其他错误在配置crosstool-NG时,也即执行./configure -prefix=/opt/crosstool-ng出现的类似“XXX:none found”的错误,都是相应工具没有安装造成的,重新运行setup.exe把该工具安装上,再执行该命令,即可。2、编译交叉工具链产生的错误2.1 targets is *not* case-sensitiveCygwin窗口的错误信息:$ ct-ng buildINFO Performing some trivial sanity checksERROR Your file system in /home/Administrator/croosstool-ng/crosstool-ng-1.9.3/targets is *not* case-sensitive!00:02 / make: * build Error 1unix 和Linux都是区分大小写的,cygwin既然是模拟unix环境,当然也是区分大小定的。这个问题好解决,修改一下注册表就行了。打开注册表,找到如下位置:HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession ManagerKernel把“obcaseinsensitive”的值改为0,再重新启动电脑,cygwin下就区分大小写了。如果觉得麻烦,可以把如下代码复制到记事本里(case-sensitive.txt):Windows Registry Editor Version 5.00HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession Managerkernelobcaseinsensitive=dword:00000000然后把记事本的后缀名改为.reg,(case-sensitive.reg),双击reg(case-sensitive.reg)文件即可,和上面的效果一样。2.1 Installing static core C compiler failedCygwin窗口的错误信息:INFO Installing static core C compilerEXTRA Configuring static core C compilerERROR checking for C compiler default output file name. configure: error: C compiler cannot create executablesconf.tab.oERROR Build failed in step Installing static core C compilerERROR Error happened in /opt/crosstool-ng/lib/ct-ng-1.9.1/scripts/functionsin function CT_DoExecLog (line unknown, sorry)x.oERROR called from /opt/crosstool-ng/lib/ct-ng-1.9.1/scripts/build/cc/gcc.shat line # 203 in function do_cc_coreil.oERROR called from /opt/crosstool-ng/lib/ct-ng-1.9.1/scripts/build/cc/gcc.shat line # 52 in function do_cc_core_pass_1ERROR called from /opt/crosstool-ng/lib/ct-ng-1.9.1/scripts/crosstool-NG.sh at line # 597 in function mainERROR Look at /home/Administrator/crosstool-ng/x-tools/arm-apollo-linux-gnueabi/build.log for more info on this error.解决办法:安装gcc4-g+,在编译的时候时需要C+的参考:/robin_l/blog/item/3087ffa1875a2d83471064bf.html2.2 Build failed in step Installing D.U.M.A.Cygwin窗口的错误信息:INFO Installing D.U.M.A.EXTRA Copying sourcesERROR Build failed in step Installing D.U.M.A.ERRORError happened in /opt/crosstool-ng-1.9.3/lib/ct-ng-1.9.3/scripts/build/debug/200-duma.sh in function do_debug_duma_build (line unknown, sorry)ERROR called from /opt/crosstool-ng-1.9.3/lib/ct-ng-1.9.3/scripts/build/debug.sh at line # 35 in function do_debugERROR called from /opt/crosstool-ng-1.9.3/lib/ct-ng-1.9.3/scripts/crosstool-NG.sh at line # 597 in function mainERROR Look at /home/Administrator/ct-ng-1.9.3/crosstool-ng/x-tools/arm-apollo-linux-gnueabi/build.log for more info on this error.ERROR (elapsed: 479:03.42)479:07 / make: * build Error 1Build.log中的提示如下:INFO Installing D.U.M.A.EXTRA Copying sourcesERROR Build failed in step Installing D.U.M.A.ERROR Error happened in /opt/crosstool-ng-1.9.3/lib/ct-ng-1.9.3/scripts/build/debug/200-duma.sh in function do_debug_duma_build (line unknown, sorry)ERROR called from /opt/crosstool-ng-1.9.3/lib/ct-ng-1.9.3/scripts/build/debug.sh atline # 35 in function do_debugERROR called from /opt/crosstool-ng-1.9.3/lib/ct-ng-1.9.3/scripts/crosstool-NG.sh at line # 597 in function mainERROR Look at /home/Administrator/ct-ng-1.9.3/crosstool-ng/x-tools/arm-apollo-linux-gnueabi/build.log for more info on this error.ERROR (elapsed: 479:03.42)解决方法:修改DUMA的Makefile文件:$ tar -zxvf duma_2_5_15.tar.gz #解压源码包$ cd duma_2_5_15打开“GNUmakefile”,添加对cygwin的支持,也就是添加下面红色的一句# some defaults:CC=gccCXX=g+AR=arRANLIB=ranlibINSTALL=installRM=rmRMFORCE=rm -fECHO=echoECHOLF=echoOS=cygwin接下来重新把duma_2_5_15打包$ cd .$ tar -zcvf duma_2_5_15.tar.gz duma_2_5_15 #重新压缩源码这个错误让我郁闷了几天,因为在build.log文件里的信息也没说出问题可能出在什么地方。最后才在INSTALL文件里发现如果是在cygwin下编译需要修改Makefile文件INSTALL文件的部分内容:his documents describes if and how the library is installed on your system.I. Linux/Unix environments (including Cygwin and MinGW):Configure the options by editing the Makefile. Read carefully the description of options at top of the Makefile. Take care for the special OS/OSTYPE depending sections. Especially if you are going to use the LD_PRELOAD mechanism.Call GNU make often called gmake for building the library.GNU make is called mingw32-make for MinGW.Add option OSTYPE=msys when calling make for MinGW.Add option OSTYPE=cygwin when calling make for Cygwin.Add option OS=osx when calling make for MacOS X or Darwin.Add option OS=freebsd when calling make for FreeBSD.Add option OS=netbsd when calling make for NetBSD.Add option OS=solaris when calling make for Solaris.2.3 Build failed in step Installing ltraceCygwin窗口的错误信息:INFO Installing ltraceEXTRA Copying sources to build dirEXTRA Configuring ltraceEXTRA Building ltraceERROR make1: * sysdeps/sysdep.o Error 2ERROR Build failed in step Installing ltraceERROR Error happened in /opt/crosstool-ng-1.9.3/lib/ct-ng-1.9.3/scripts/functions in function CT_DoExecLog (line unknown, sorry)ERROR called from /opt/crosstool-ng-1.9.3/lib/ct-ng-1.9.3/scripts/build/debug/400-ltrace.sh at line # 52 in functiondo_debug_ltrace_buildERROR called from /opt/crosstool-ng-1.9.3/lib/ct-ng-1.9.3/scripts/build/debug.sh at line # 35 in function do_debugERROR called from /opt/crosstool-ng-1.9.3/lib/ct-ng-1.9.3/scripts/crosstool-NG.sh at line # 597 in function mainERROR Look at /home/Administrator/ct-ng-1.9.3/crosstool-ng/x-tools/arm-apollo-linux-gnueabi/build.log for more info on this error.ERROR (elapsed: 591:35.21)591:39 / make: * build Error 2Build.log中的提示如下:ALL make1: Entering directory /home/Administrator/ct-ng-1.9.3/crosstool-ng/crosstool-ng-1.9.3_build/ targets/arm-apollo-linux-gnueabi/build/build-ltraceALL arm-apollo-linux-gnueabi-gcc -Wall -g -O2 -iquote /home/Administrator/ct-ng-1.9.3/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-apollo-linux-gnueabi/build/build-ltrace -iquote /home/Administrator/ct-ng-1.9.3/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-apollo-linux-gnueabi/build/build-ltrace/sysdeps/CYGWIN_NT-5.1 -DSYSCONFDIR=/usr/etc -c -o main.o main.cALL /usr/bin/make -C sysdeps/CYGWIN_NT-5.1ALL make: Entering an unknown directoryALL make: * sysdeps/CYGWIN_NT-5.1: No such file or directory. Stop.ALL make: Leaving an unknown directoryERROR make1: * sysdeps/sysdep.o Error 2ALL make1: Leaving directory /home/Administrator/ct-ng-1.9.3/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-apollo-linux-gnueabi/build/build-ltraceERROR Build failed in step Installing ltraceERROR Error happened in /opt/crosstool-ng-1.9.3/lib/ct-ng-1.9.3/scripts/functions in function CT_DoExecLog (line unknown, sorry)ERROR called from /opt/crosstool-ng-1.9.3/lib/ct-ng-1.9.3/scripts/build/debug/400-ltrace.sh at line # 52 in function do_debug_ltrace_buildERROR called from /opt/crosstool-ng-1.9.3/lib/ct-ng-1.9.3/scripts/build/debug.sh at line # 35 in function do_debugERROR called from /opt/crosstool-ng-1.9.3/lib/ct-ng-1.9.3/scripts/crosstool-NG.sh at line # 597 in function mainERROR Look at /home/Administrator/ct-ng-1.9.3/crosstool-ng/x-tools/arm-apollo-linux-gnueabi/build.log for more info on this error.ERROR (elapsed: 591:39)解决方法:在配置文件中把ltrace这一项去掉,原因很简单,ltrace不支持windows,只支持linux,在README文件中有说明,之所以能知道这个是受解决上一个错误的启发,查看了ltrace的README文件,原文如下:4. Where does it work-It works with ELF based Linux systems running on i386, m68k, S/390,ARM, PowerPC, PowerPC64, IA64, AMD64, SPARC and Alpha processors.It is part of at least Debian GNU/Linux, RedHat, SuSE, Mandrake.2.4 Build failed in step Installing libelf for the targetCygwin窗口的错误信息:INFO Installing libelf for the targetEXTRA Configuring libelfEXTRA Building libelfERROR make2: * de.cat Segmentation fault (core dumped)ERROR make1: * all-recursive Error 1ERROR Build failed in step Installing libelf for the targetERROR Error happened in /opt/crosstool-ng/lib/ct-ng-1.9.1/scripts/functions in function CT_DoExecLog (line unknown, sorry)ERROR called from /opt/crosstool-ng/lib/ct-ng-1.9.1/scripts/build/companion_libs/libelf.shat line # 87 in function do_libelf_targetERROR called from /opt/crosstool-ng/lib/ct-ng-1.9.1/scripts/crosstool-NG.sh at line #597 in function mainERROR Look at /home/Administrator/crosstool-ng/x-tools/arm-apollo-linux-gnueabi/build.log for more info on this error.ERROR (elapsed: 469:21.42)469:27 / make: * build Error 2Build.log的提示如下:ALL ranlib libelf.aALL make2: Leaving directory /home/Administrator/crosstool-ng/crosstool-ng-1.9.1_build/targets/arm-apollo-linux-gnueabi/build/build-libelf-for-target/libALL making all in poALL make2: Entering directory /home/Administrator/crosstool-ng/crosstool-ng-1.9.1_build/targets/arm-apollo-linux-gnueabi/build/build-libelf-for-target/poALL /usr/bin/gencat de.cat /home/Administrator/crosstool-ng/crosstool-ng-1.9.1_build/targets/src/libelf-0.8.13/po/de.msgERROR make2: * de.cat Segmentation fault (core dumped)ALL make2: Leaving directory /home/Administrator/crosstool-ng/crosstool-ng-1.9.1_build/targets/arm-apollo-linux-gnueabi/build/build-

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论