18.16 gcc-3.4.5编译错误及解决方法集锦
18.16.1 自写BootLoader错误
ERROR :
boot.c:: warning: return type of 'main' is not `int'
ANSWER :
int main(void){
……
return -;/*执行到这里就出错了*/
}
ERROR :
boot.c: In function `main':【未声明】
boot.c:: warning: implicit declaration of function `uart0_init'
boot.c:: warning: implicit declaration of function `puts'
boot.c:: warning: implicit declaration of function `nand_read'
ANSWER :
在函数前声明即可
ERROR :
boot.c:: warning: passing arg of `nand_read' makes pointer from integer without a cast
ANSWER :
将整型强制类型转换为指针
nand_read(0x60000+, (unsigned char *)0x30008000, 0x200000);
ERROR :
init.c: In function `isBootFromNorFlash':
init.c:: warning: integer constant is too large for "long" type
init.c:: warning: overflow in implicit constant conversion
init.c:: warning: integer constant is too large for "long" type
init.c:: warning: comparison is always false due to limited range of data type
ANSWER :
是0x12345678不是0x123456789(超出整型2^)
volatile int *p = (volatile int *);//
int val; //用来保存原来的值,在判断完后恢复
val = *p;
*p = 0x12345678;
ERROR :
init.c:: warning: conflicting types for built-in function 'puts'
boot.c:: warning: conflicting types for built-in function 'puts'
boot.c:: warning: conflicting types for built-in function 'strcpy'
ANSWER :
/*错误原因:
* 编译器自带了strcpy和自己写的strcpy函数类型冲突
* 在Makefile链接的时候加
* CPPFLAGS :=-nostdinc -nostdlib
*/
The ISO C90 functions
abort, abs, acos, asin, atan2, atan, calloc, ceil, cosh,cos, exit, exp, fabs,
floor, fmod, fprintf, fputs, frexp, fscanf, isalnum, isalpha,iscntrl, isdigit,
isgraph, islower, isprint, ispunct, isspace, isupper, isxdigit,tolower, toupper,
labs, ldexp, log10, log, malloc, memchr, memcmp, memcpy, memset,modf,
pow, printf, putchar, puts, scanf, sinh, sin, snprintf, sprintf, sqrt, sscanf,
strcat, strchr, strcmp, strcpy, strcspn, strlen, strncat, strncmp,
strncpy, strpbrk,strrchr, strspn, strstr, tanh, tan, vfprintf, vprintf and vsprintf
are all recognized as built-in functions unless ‘-fno-builtin’ is specified (or ‘-fno-builtin-function’ is specified for an individual function). All of these functions have corresponding versions
prefixed with __builtin_. 将Makefile中CPPFLAGS := -nostdinc
改为CPPFLAGS := -nostdinc -fno-builtin
ERROR 06:
my_printf.c:(.text+0x120):undefined reference to `__aeabi_uidivmod`
my_printf.c:(.text+0x158):undefined reference to `__aeabi_uidiv`
ANSWER 06:
/*编译器找不到除法函数*/
在arm-linux-gcc-4.3.2编译器使用libgcc.a中的除法可以
在arm-linux-gcc-3.4.5编译器使用lib1funcs.S中的除法可以
ERROR 07:
book@book-desktop:/work/system/linux-2.6.22.6$ sudo make uImage
编译刚解压的目录时,显示如下错误:
[sudo] password for lsb: make: arm-linux-gnu-gcc: Command not found
CHK include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
CHK include/linux/utsrelease.h
CC arch/arm/kernel/asm-offsets.s
/bin/sh: arm-linux-gnu-gcc: not found
make[1]: *** [arch/arm/kernel/asm-offsets.s] Error 127
make: *** [prepare0] Error 2
ANSWER 07:
在根目录下没有权限。
sudo chmod 777 kernel -R
其中,kernel为内核目录。
最值得注意的是:定目录的Makefile 是否该为相对应的交叉工具链
18.16 gcc-3.4.5编译错误及解决方法集锦的更多相关文章
- vs2010打包系统必备选择.net framework 3.5sp1编译错误的解决方法
利用visual studio 2010进行打包程序,默认安装的是Framework 4.0,如果需要将3.5sp1打包到系统中一起安装(选择了"从与我的应用程序相同的位置下载系统必备组件& ...
- VC6的工程转到VC2010或更高版本出现fatal error C1189编译错误的解决方法
以前也遇到过,当时解决了没写下来,这次正好又遇到了,就顺手写一下吧,别下次又忘记了. 当VC6的工程转到VC2010或更高版本时编译出现如下错误: c:\program files\microsoft ...
- 最新版Duilib在VS2012下编译错误的解决方法
svn了好几次最新版本的项目源代码, 在VS2012下编译老是出错, 改了后没记录, 结果又忘记, 所以在此记录下. 这个问题很普遍, 非常多的人遇到. 至于 ...
- Ncut源码编译错误的解决方法
NCut是一个比较老的开源代码了.所以在新的matlab的环境下老出各种bug. 经过自己的各种折腾,总结为一下几点: 1.保证matlab的mex是有C编译器可以用的,具体可以用 mex -setu ...
- gcc 引用math 库 编译的问题 解决方法
1.gcc app.c -lm 其中lm表示的是连接 m forlibm.so / libm.a表示你想要的库 abc for libabc.so / libabc.a 其中.a表示的是静态链接库 . ...
- Office Word等双击空白处的“隐藏的模块中的编译错误:MTW5”解决
Microsoft Visual Basic for Applications 隐藏的模块中的编译错误:MTW5. ...
- Android编译环境——ubuntu12.04上android2.3.4编译错误以及解决
Android编译环境——ubuntu12.04上android2.3.4编译错误以及解决 分类: android应用开发2013-08-21 09:20 4222人阅读 评论(3) 收藏 举报 li ...
- GCC-4.6.3编译linux2.6.32.12内核出现“重复的成员‘page’”错误的解决方法
使用gcc4.6.3编译linux2.6.32.12内核出现错误如下: In file included from drivers/net/igbvf/ethtool.c:36:0: drivers/ ...
- 编译android源码遇到错误及其解决方法
升级ubuntu的14.04后,android的源码又编译错误了,一下是错误说明赫解决方法: 1.make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_ ...
随机推荐
- struts校验
Struts2 校验框架 Struts2 和Struts1同样也提供了校验框架,但在Struts2 已经不再把校验框架做为一个插件,而是已经内置到了Struts2中,而且配置起来更为简单方便,功能也更 ...
- Python基础(条件判断,循环,占位符等)
Python 自动化 系统开发用的语言和自动化脚本可以不同 学习peython可用于: 网路爬虫,数据分,web开发,人工智能,自动化运维,自动化测试,嵌入式,黑客 第三方库比较全 脚本语言:功能单一 ...
- Python Day2 Learning record
一.python初始化模块 Python的强大之处在于他有非常丰富和强大的标准库和第三方库 ...
- Codeforces Round #162 (Div. 1) B. Good Sequences (dp+分解素数)
题目:http://codeforces.com/problemset/problem/264/B 题意:给你一个递增序列,然后找出满足两点要求的最长子序列 第一点是a[i]>a[i-1] 第二 ...
- 棋盘(noip2017普及组)
题目描述 有一个m \times mm×m的棋盘,棋盘上每一个格子可能是红色.黄色或没有任何颜色的.你现在要从棋盘的最左上角走到棋盘的最右下角. 任何一个时刻,你所站在的位置必须是有颜色的(不能是无色 ...
- 精进之路之lru
原理 LRU(Least recently used,最近最少使用)算法根据数据的历史访问记录来进行淘汰数据,其核心思想是“如果数据最近被访问过,那么将来被访问的几率也更高”. 实现1 最常见的实现是 ...
- 帝国cms中下拉框select的绑定
在修改数据模型中,将下拉框的表示代码换成下: 将id换成自己的id地址.数据库查询中的classid换成自己创建栏目的id. <select name="diqu" id=& ...
- 页面添加锚点后如何点击不改变URL?
直接奔主题,前端简单地锚点实现方法大家都会,无非就是在把 a 标签的 href 写成想要跳到的元素的id ,比如点击 <a href="#box"></a> ...
- SharePoint 2013 新特性 (三) 破改式 —— 设计管理器的使用 [2.HTML变身模板页]
假设你跟我一样,看到了一个非常漂亮的页面,想把这种风格放到SharePoint里,咋办呢,那肯定得自定义个模板页了,好点是SharePoint Designer搞定,差点就得用Visual Studi ...
- git教程:工作区和暂存区
Git和其他版本控制系统如SVN的一个不同之处就是有暂存区的概念. 先来看名词解释. 工作区(Working Directory) 就是你在电脑里能看到的目录,比如我的learngit文件夹就是一个工 ...