第一篇:Android4.0编译错误记录
1.make: ***
[out/host/linux-x86/obj/STATIC_LIBRARIES/libMesa_intermediates/src/glsl/linker.o] Error 1 解决方法: vim external/mesa3d/src/glsl/linker.cpp
添加:
#include
2.make: ***
[out/host/linux-x86/obj/EXECUTABLES/test-librsloader_intermediates/test-librsloader] Error 1 解决办法:
vim external/llvm/llvm-host-build.mk
添加:
LOCAL_LDLIBS :=-lpthread-ldl
3.make: ***
[out/host/linux-x86/obj/STATIC_LIBRARIES/libgtest_host_intermediates/gtest-all.o] Error 1 解决方法:
vim external/gtest/include/gtest/internal/gtest-param-util.h
添加:
#include
4.
第二篇:BUSYBOX编译错误及解决方法总结
编译busybox的组合:
busybox-1.0.0 arm-linux-gcc-2.95.3(AT91rm9200开发板)
经典参考:
http://busybox.net/downloads/ 下载busybox http://husaberg.toby-churchill.com/balloon/releases/v0.7/roots/ 文件系统制作
移植基本过程:
1.到http://busybox.net/downloads/busybox-1.7.3.tar.bz2下载busybox;2.解压busybox1.7.3 tar jxvf busybox-1.7.3.tar.bz2 3.make defconfig 4.make menuconfig
在[build options]中选择[Build busybox as a static binary] 主要是C库的连接方式,安装目录等。5.make 6.创建rootfs目录 7.make install
编译过程可能出现以下错误,解决方法如下:
可能会出现的错误:
1.出现如下错误
CC miscutils/taskset.o miscutils/taskset.c:17: error: parse error before '*' token miscutils/taskset.c:18: warning: function declaration isn't a prototype miscutils/taskset.c: In function `__from_cpuset':
miscutils/taskset.c:22: error: `CPU_SETSIZE' undeclared(first use in this function)
miscutils/taskset.c:22: error:(Each undeclared identifier is reported only once miscutils/taskset.c:22: error: for each function it appears in.)miscutils/taskset.c:26: warning: implicit declaration of function `CPU_ISSET' miscutils/taskset.c:26: error: `mask' undeclared(first use in this function)miscutils/taskset.c: In function `taskset_main': miscutils/taskset.c:47: error: `cpu_set_t' undeclared(first use in this function)
miscutils/taskset.c:47: error: parse error before “mask” miscutils/taskset.c:68: warning: implicit declaration of function `CPU_ZERO' miscutils/taskset.c:68: error: `new_mask' undeclared(first use in this function)
miscutils/taskset.c:69: error: `CPU_SETSIZE' undeclared(first use in this function)miscutils/taskset.c:71: warning: implicit declaration of function `CPU_SET'
miscutils/taskset.c:78: error: `mask' undeclared(first use in this function)
make[1]: *** [miscutils/taskset.o] Error 1
make: *** [miscutils] Error 2
make menuconfig 找到[Miscellaneous Utilities],去掉[task set]
2.如下错误:
time.c libbb/time.c:20: error: “CLOCK_MONOTONIC” undeclared(first use in this function)make menuconfig
去掉Busybox Settings->Busybox Library Tuning->[]Use clock_gettie(CLOCK_MONOTONIC)syscall
3.出现如下错误:
In file included from /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/sys-include/linux/fs.h:12,from /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/sys-include/linux/capability.h:17,from /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/sys-include/linux/binfmts.h:5,from /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/sys-include/linux/sched.h:9,from /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/sys-include/net/inetpeer.h:14,from /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/sys-include/net/route.h:28,from /busybox-1.01/networking/route.c:42: /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/sys-include/linux/wait.h:4: warning: `WNOHANG' redefined /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/include/bits/waitflags.h:26: warning: this is the location of the previous definition /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/sys-include/linux/wait.h:5: warning: `WUNTRACED' redefined /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/include/bits/waitflags.h:27: warning: this is the location of the previous definition In file included from /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/sys-include/linux/sched.h:77,from /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/sys-include/net/inetpeer.h:14,from /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/sys-include/net/route.h:28,from /busybox-1.01/networking/route.c:42: /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/sys-include/linux/time.h:108: warning: `FD_SET' redefined /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/include/sys/select.h:83: warning: this is the location of the previous definition /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/sys-include/linux/time.h:109: warning: `FD_CLR' redefined /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/include/sys/select.h:84: warning: this is the location of the previous definition /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/sys-include/linux/time.h:110: warning: `FD_ISSET' redefined /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/include/sys/select.h:85: warning: this is the location of the previous definition /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/sys-include/linux/time.h:111: warning: `FD_ZERO' redefined /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/include/sys/select.h:86: warning: this is the location of the previous definition In file included from /busybox-1.01/networking/route.c:42: /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/sys-include/net/route.h:34: warning: #warning This file is not supposed to be used outside of kernel.…… ……
In file included from /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/include/netdb.h:38,from /busybox-1.01/include/libbb.h:36,from /busybox-1.01/include/busybox.h:54,from /busybox-1.01/networking/route.c:44: /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/include/bits/siginfo.h:34: redefinition of `union sigval' /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/include/bits/siginfo.h:37: warning: redefinition of `sigval_t' /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/sys-include/asm/siginfo.h:11: warning: `sigval_t' previously declared here /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/include/bits/siginfo.h:274: redefinition of `struct sigevent' /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/include/bits/siginfo.h:289: warning: redefinition of `sigevent_t' /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/sys-include/asm/siginfo.h:211: warning: `sigevent_t' previously declared here /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../arm-linux/include/bits/siginfo.h:298: parse error before `0' In file included from /busybox-1.01/include/busybox.h:54,from /busybox-1.01/networking/route.c:44: /busybox-1.01/include/libbb.h:112: warning: declaration of `flags' shadows global declaration /busybox-1.01/include/libbb.h:113: warning: declaration of `flags' shadows global declaration /busybox-1.01/include/libbb.h:135: warning: declaration of `flags' shadows global declaration /busybox-1.01/include/libbb.h:251: warning: declaration of `flags' shadows global declaration /busybox-1.01/include/libbb.h:256: redefinition of `struct sysinfo' /busybox-1.01/include/libbb.h:272: warning: declaration of `info' shadows global declaration /busybox-1.01/include/libbb.h:309: warning: declaration of `flags' shadows global declaration /busybox-1.01/include/libbb.h:440: warning: declaration of `flags' shadows global declaration /busybox-1.01/networking/route.c:475: warning: declaration of `flags' shadows global declaration /busybox-1.01/networking/route.c: In function `set_flags': /busybox-1.01/networking/route.c:476: warning: declaration of `flags' shadows global declaration /busybox-1.01/networking/route.c: In function `displayroutes': /busybox-1.01/networking/route.c:490: warning: declaration of `flags' shadows global declaration make: *** [/busybox-1.01/networking/route.o] Error 1 去掉Busybox Settings->NetWork device-->[]route
4.如下错误:
usr/src/armlinux/busybox-1.0.0/libbb/loop.c:32:linux/version.h:No such file or directory /usr/src/armlinux/busybox-1.0.0/libbb/loop.c:35 arse error /usr/src/armlinux/busybox-1.0.0/libbb/loop.c:37 arse error 将内核源码下的include/linux目录下的versition.h文件
放到 busybox-1.0.0/include/linux下
.....
第三篇:IAR 6 20编译错误
IAR 6.20编译错误清单
1、①错误描述:Tool Internal Error:
Internal Error: [CoreUtil/General]: Access violation(0xc0000005)at 007588A5(reading from address 0x0)
Internal Error: [CoreUtil/General]: Access violation(0xc0000005)at 007588A5(reading from address 0x0)
Error while running C/C++ Compiler
②错误原因:High配置设置为Size,应该为Low2、①错误描述:Fatal Error[Pe1696]: cannot open source file “inc/hw_types.h” E:StellarisWareM3_9D92boardsdk-lm3s9b96boot_demo2boot_demo2.c 25②错误原因:C/C++ Complier(Assember)->Preprocessor->Additional include directories: $PROJ_DIR$.$PROJ_DIR$..$PROJ_DIR$......3、①错误描述:Fatal Error[Pe1696]: cannot open source file
“lwip/opt.h”
E:StellarisWareM3_9D92utilslwiplib.h 4
4②错误原因:C/C++ Complier-(Assember)>Preprocessor->Additional include directories:
$PROJ_DIR$......third_partylwip-1.3.2apps
$PROJ_DIR$......third_partybget
$PROJ_DIR$......third_partylwip-1.3.2portsstellarisinclude
$PROJ_DIR$......third_partylwip-1.3.2srcinclude
$PROJ_DIR$......third_partylwip-1.3.2srcincludeipv4
$PROJ_DIR$......third_partylwip-1.3.2srcincludelwip
$PROJ_DIR$......third_party4、①错误描述:Fatal Error[Pe035]: #error directive: Unrecognized COMPILER!E:StellarisWareM3_9D92boardsdk-lm3s9b96driversset_pinout.h 59
Error while running C/C++ Compiler
②错误原因:C/C++ Complier-(Assember)>Preprocessor->Defined symbols: ewarm5、①错误描述:Error[Pe020]: identifier “ROM_pvAESTable” is undefined E:StellarisWareM3_9D92third_partyaesaes.c 319
②错误原因:
6、①错误描述:Error[Li005]: no definition for “main” [referenced from cmain.o(rt7M_tl.a)]Error while running Linker
②错误原因:定义函数:int main(void){ return(0);}
7、①错误描述:Error[Li005]: no definition for “main” [referenced from cmain.o(rt7M_tl.a)]Error while running Linker
②错误原因:如果是库是库函数,在:General Options->Output->Output file:选择: Library项
4、①错误描述:Fatal Error[Pe1696]: cannot open source file “uip.h” E:StellarisWareM3_9D92third_partyuip-1.0appsdhcpcdhcpc.c 37
②错误原因:
5、①错误描述:
②错误原因:
$PROJ_DIR$......third_partylwip-1.3.2apps
$PROJ_DIR$......third_partybget
$PROJ_DIR$......third_partylwip-1.3.2portsstellarisinclude
$PROJ_DIR$......third_partylwip-1.3.2srcinclude
$PROJ_DIR$......third_partylwip-1.3.2srcincludeipv
4$PROJ_DIR$......third_party
$PROJ_DIR$......third_partyuip-1.0
$PROJ_DIR$......third_partyuip-1.0uip
$PROJ_DIR$......third_partyuip-1.0apps
$PROJ_DIR$......third_partyspeex-1.2rc1include
$PROJ_DIR$......third_partyspeex-1.2rc1includespeex
$PROJ_DIR$......third_partyspeex-1.2rc1stellaris6、①错误描述:Fatal Error[Pe035]: #error directive: You now need to define either FIXED_POINT or FLOATING_POINT E:StellarisWareM3_9D92third_partyspeex-1.2rc1libspeexarch.h 65②错误原因:
7、①错误描述:Fatal Error[Pe035]: #error directive: “Unrecognized/undefined driver for DISK0!”
E:StellarisWareM3_9D92third_partyfatfsportdual-disk-driver.c 6
2Error while running C/C++ Compiler
②错误原因:
UART_BUFFERED
DISK0_DK_LM3S9B96
DISK1_USB_MSC
INCLUDE_BGET_STATS8、①错误描述:Error[Pe020]: identifier “ROM_pvAESTable” is undefined E:SWM3_9D92(6.20)third_partyaesaes.c 359
Error while running C/C++ Compiler
②错误原因:
10、①错误描述:Fatal Error[Pe035]: #error directive: You now need to define either FIXED_POINT or FLOATING_POINT E:SWM3_9D92(6.20)third_partyspeex-1.2rc1libspeexarch.h 6
5Error while running C/C++ Compiler
②错误原因:
11、①错误描述:
Error[Li005]: no definition for “ROM_SysCtlClockSet” [referenced from E:SWM3_9D92(6.20)boardsdk-lm3s9b96safertos_demoDebugObjsafertos_demo.o] Error[Li005]: no definition for “ROM_FlashUserGet” [referenced from E:SWM3_9D92(6.20)boardsdk-lm3s9b96safertos_demoDebugObjlwip_task.o]
Error[Li005]: no definition for “ROM_IntPrioritySet” [referenced from E:SWM3_9D92(6.20)boardsdk-lm3s9b96safertos_demoDebugObjlwip_task.o]
Error[Li005]: no definition for “ROM_GPIOPinTypeGPIOOutput” [referenced from E:SWM3_9D92(6.20)boardsdk-lm3s9b96safertos_demoDebugObjled_task.o]
Error[Li005]: no definition for “ROM_GPIOPinWrite” [referenced from E:SWM3_9D92(6.20)boardsdk-lm3s9b96safertos_demoDebugObjled_task.o]
Error[Lp011]: section placement failed: unable to allocate space for sections/blocks with a total estimated minimum size of 0x11e54 bytes
in
<[0x20000000-0x2000ffff]>(total uncommitted space 0x10000).Error while running Linker
②错误原因:
12、①错误描述:
Error[Lp011]: section placement failed: unable to allocate space for sections/blocks with a total estimated minimum size of 0x11e54 bytes in <[0x20000000-0x2000ffff]>(total uncommitted space 0x10000).Error while running Linker
第四篇:Ubuntu 11.10编译Android源码错误
Ubuntu 11.10编译Android源码错误
问题1:
frameworks/base/libs/utils/RefBase.cpp: 在成员函数
‘void android::RefBase::weakref_type::trackMe(bool, bool)’中:
frameworks/base/libs/utils/RefBase.cpp:483:67: 错误: 将
‘constandroid::RefBase::weakref_impl’作为
‘voidandroid::RefBase::weakref_impl::trackMe(bool, bool)’的‘this’实参时丢弃了类型限定[-fpermissive]
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/RefBase.o] 错误 1 原因:Ubuntu 11.10的gcc 4.6版本太高了,android编译需要gcc 4.4
解决办法:更换gcc、g++版本4.6为4.4
sudo apt-get install gcc-4.4
sudo apt-get install g++-4.4
sudo rm-rf /usr/bin/gcc /usr/bin/g++
sudo ln-s /usr/bin/gcc-4.4 /usr/bin/gcc
sudo ln-s /usr/bin/g++-4.4 /usr/bin/g++
问题2:
g++: 错误: –fpermissive:没有那个文件或目录
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/RefBase.o] 错误 1 解决办法:sudoapt-get install g++-4.4-multilib
经过此操作编译可顺利进行。
第五篇:APUE编译错误小结(写写帮整理)
linux下《UNIX环境高级编程》(apue2)源码编译出错的处理方法相信很多跟我一样想要学习unix编程的朋友在兴冲冲拿到《unix环境高级编程》后,准备拿源码练练手时,执行第一个myls就出现一大堆的错误,这未免时个不小的打击。今天把解决方法写下来,第一自己有个记录,第二也帮助那些被同样问题困扰的朋友尽快的进入linux美丽的世界。(只限linux系统)
首先需要make一次源代码
编辑源码解压生成的apue.2e文件夹下的Make.defines.linux 修改WKDIR=/home/var/apue.2e为你的apue.2e目录,比如我的apue源码解压在/home/lc,那我就改为:
WKDIR=/home/lc/apue.2e 然后进入apue.2e/std 目录,编辑linux.mk。修改里面所有的nawk为awk。最后返回apue.2e目录,执行make命令: 在我的机器上编译时,提示ARG_MAX未定义,可以这么修改。在apue.2e/include/apue.h中添加一行:
#define ARG_MAX 4096 打开apue.2e/threadtl/getenv1.c 和apue.2e/threadctl/getenv3.c,添加一行: #include “apue.h” 这样就可以编译通过了,复制apue.2e/include/apue.h到/usr/include下,apue.2e/lib/libapue.a 到/usr/lib/和 /usr/lib64下。
以下是编译源码时的错误提示跟解决方法(假定你的工作目录跟我的一样,为/usr/local/apue.2e)错误提示1:
myls.c:1:19: apue.h: No such file or directory myls.c: In function `main': myls.c:13: error: `NULL' undeclared(first use in this function)myls.c:13: error:(Each undeclared identifier is reported only once myls.c:13: error: for each function it appears in.)解决办法:
拷贝apue.h到系统默认头文件目录中
$cp /usr/local/apue.2e/include/apue.h /usr/include 错误提示2:
/tmp/ccBBopm0.o(.text+0x2b): In function `main': : undefined reference to `err_quit' /tmp/ccBBopm0.o(.text+0x5f): In function `main': : undefined reference to `err_sys' collect2: ld returned 1 exit status 解决办法:
err_quit跟err_sys是作者自己定义的错误处理函数,需要单独定义头文件 在/usr/include 下新建一个名为myerr.h的文件
拷贝下边的内容到myerr.h(其实此头文件在原书的附录B中)#include “apue.h” #include
va_list ap;
va_start(ap, fmt);
err_doit(1, errno, fmt, ap);
va_end(ap);} /* * Fatal error related to a system call.* Print a message and terminate.*/ void err_sys(const char *fmt,...){
va_list ap;
va_start(ap, fmt);
err_doit(1, errno, fmt, ap);
va_end(ap);
exit(1);} /* * Fatal error unrelated to a system call.* Error code passed as explict parameter.* Print a message and terminate.*/ void err_exit(int error, const char *fmt,...){
va_list ap;
va_start(ap, fmt);
err_doit(1, error, fmt, ap);
va_end(ap);
exit(1);} /* * Fatal error related to a system call.* Print a message, dump core, and terminate.*/ void err_dump(const char *fmt,...){
va_list ap;
va_start(ap, fmt);
err_doit(1, errno, fmt, ap);
va_end(ap);
abort();/* dump core and terminate */
exit(1);/* shouldn't get here */ } /* * Nonfatal error unrelated to a system call.* Print a message and return.*/ void err_msg(const char *fmt,...){
va_list ap;
va_start(ap, fmt);
err_doit(0, 0, fmt, ap);
va_end(ap);} /* * Fatal error unrelated to a system call.* Print a message and terminate.*/ void err_quit(const char *fmt,...){
va_list ap;
va_start(ap, fmt);
err_doit(0, 0, fmt, ap);
va_end(ap);
exit(1);} /* * Print a message and return to caller.* Caller specifies “errnoflag”.*/ static void err_doit(int errnoflag, int error, const char *fmt, va_list ap){
char buf[MAXLINE];vsnprintf(buf, MAXLINE, fmt, ap);if(errnoflag)
snprintf(buf+strlen(buf), MAXLINE-strlen(buf), “: %s”,strerror(error));strcat(buf, “ ”);fflush(stdout);/* in case stdout and stderr are the same */ fputs(buf, stderr);fflush(NULL);/* flushes all stdio output streams */ } 然后在你需要使用这几种错误处理函数的程序源代码里加入: #include “myerr.h”
至此,APUE就可以顺利编译啦