18.16.1 自写BootLoader错误

  1. ERROR
  2.   boot.c:: warning: return type of 'main' is not `int'
  3. ANSWER :
  4.   int main(void){
  5.    ……
  6.    return -;/*执行到这里就出错了*/
  7.   }
  8. ERROR :
  9.   boot.c: In function `main':【未声明】
  10.   boot.c:: warning: implicit declaration of function `uart0_init'
  11.   boot.c:: warning: implicit declaration of function `puts'
  12.   boot.c:: warning: implicit declaration of function `nand_read'
  13. ANSWER :
  14.   在函数前声明即可
  15. ERROR :
  16.   boot.c:: warning: passing arg of `nand_read' makes pointer from integer without a cast
  17. ANSWER
  18.   将整型强制类型转换为指针
  19.   nand_read(0x60000+, (unsigned char *)0x30008000, 0x200000);
  20. ERROR
  21.   init.c: In function `isBootFromNorFlash':
  22.   init.c:: warning: integer constant is too large for "long" type
  23.   init.c:: warning: overflow in implicit constant conversion
  24.   init.c:: warning: integer constant is too large for "long" type
  25.   init.c:: warning: comparison is always false due to limited range of data type
  26. ANSWER :
  27.   是0x12345678不是0x123456789(超出整型2^)
  28.    volatile int *p = (volatile int *);//
  29.    int val; //用来保存原来的值,在判断完后恢复
  30.    val = *p;
  31.    *p = 0x12345678;
  32. ERROR :
  33.   init.c:: warning: conflicting types for built-in function 'puts'
  34.   boot.c:: warning: conflicting types for built-in function 'puts'
  35.   boot.c:: warning: conflicting types for built-in function 'strcpy'
  36. ANSWER :
  37.   /*错误原因:
  38.   * 编译器自带了strcpy和自己写的strcpy函数类型冲突
  39.   * 在Makefile链接的时候加
  40.   * CPPFLAGS :=-nostdinc -nostdlib
  41.   */
  42.   The ISO C90 functions
  43.   abort, abs, acos, asin, atan2, atan, calloc, ceil, cosh,cos, exit, exp, fabs,
  44.   floor, fmod, fprintf, fputs, frexp, fscanf, isalnum, isalpha,iscntrl, isdigit,
  45.   isgraph, islower, isprint, ispunct, isspace, isupper, isxdigit,tolower, toupper,
  46.   labs, ldexp, log10, log, malloc, memchr, memcmp, memcpy, memset,modf,
  47.   pow, printf, putchar, puts, scanf, sinh, sin, snprintf, sprintf, sqrt, sscanf,
  48.   strcat, strchr, strcmp, strcpy, strcspn, strlen, strncat, strncmp,
  49.   strncpy, strpbrk,strrchr, strspn, strstr, tanh, tan, vfprintf, vprintf and vsprintf
  50.   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
  51.   prefixed with __builtin_.
  52.  
  53.   将Makefile中CPPFLAGS := -nostdinc
  54.   改为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编译错误及解决方法集锦的更多相关文章

  1. vs2010打包系统必备选择.net framework 3.5sp1编译错误的解决方法

    利用visual studio 2010进行打包程序,默认安装的是Framework 4.0,如果需要将3.5sp1打包到系统中一起安装(选择了"从与我的应用程序相同的位置下载系统必备组件& ...

  2. VC6的工程转到VC2010或更高版本出现fatal error C1189编译错误的解决方法

    以前也遇到过,当时解决了没写下来,这次正好又遇到了,就顺手写一下吧,别下次又忘记了. 当VC6的工程转到VC2010或更高版本时编译出现如下错误: c:\program files\microsoft ...

  3. 最新版Duilib在VS2012下编译错误的解决方法

            svn了好几次最新版本的项目源代码, 在VS2012下编译老是出错, 改了后没记录, 结果又忘记, 所以在此记录下.        这个问题很普遍, 非常多的人遇到.       至于 ...

  4. Ncut源码编译错误的解决方法

    NCut是一个比较老的开源代码了.所以在新的matlab的环境下老出各种bug. 经过自己的各种折腾,总结为一下几点: 1.保证matlab的mex是有C编译器可以用的,具体可以用 mex -setu ...

  5. gcc 引用math 库 编译的问题 解决方法

    1.gcc app.c -lm 其中lm表示的是连接 m forlibm.so / libm.a表示你想要的库 abc for libabc.so / libabc.a 其中.a表示的是静态链接库 . ...

  6. Office Word等双击空白处的“隐藏的模块中的编译错误:MTW5”解决

    Microsoft Visual Basic for Applications 隐藏的模块中的编译错误:MTW5. ...

  7. Android编译环境——ubuntu12.04上android2.3.4编译错误以及解决

    Android编译环境——ubuntu12.04上android2.3.4编译错误以及解决 分类: android应用开发2013-08-21 09:20 4222人阅读 评论(3) 收藏 举报 li ...

  8. 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/ ...

  9. 编译android源码遇到错误及其解决方法

    升级ubuntu的14.04后,android的源码又编译错误了,一下是错误说明赫解决方法: 1.make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_ ...

随机推荐

  1. webservice接口,用Soapui

    webservice接口怎么测试呢,他不需要你在拼报文了,会给一个webservice的地址,或者wsdl文件,直接在soapui导入,就可以看到这个webservice里面的所有接口,也有报文,直接 ...

  2. 函数QFileSystemModelPrivate::_q_fileSystemChanged

    由于Qt的体系过于庞大,即使是某个模块,分析起来也十分困难.对于QFileSystemModel,我们在这里对单个重要函数慢慢分析 1 /*! \internal The thread has rec ...

  3. 模拟setTimeOut

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...

  4. 深入理解java虚拟机《一》

    一.java发展史 1995.5.23 Oak语言改名为java,sun正式发布java 1.0版本 1996.1.23 JDK 1.0发布,java语言第一个正式版本运行环境 主要包括:java虚拟 ...

  5. v-echart 按需加载

    import 'v-charts/lib/style.css';import VeBar from 'v-charts/lib/bar' // 条形图import VeRadar from 'v-ch ...

  6. oracle 数据库备份expdp、impdp

    跳转查看:https://blog.csdn.net/qq_26230421/article/details/79382013 或 https://www.cnblogs.com/promise-x/ ...

  7. WEEX入坑指南(1)

    weex create newtest 然后在某个阶段卡死, 解决方案: 在路径下创建新建文件夹,并命名为项目的名称.

  8. oracle 修改服务端字符集编码

    进入服务端的sqlplus命令界面 SELECT * FROM V$NLS_PARAMETERS; 可以查看参数的值. 解决字符集编码 NLS_CHARACTERSET 办法: UPDATE PROP ...

  9. mac安装brew简单方法

    安装方法:命令行输入 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/ma ...

  10. Linux 文件恢复

    可以恢复,使用系统自还工具debugfs来还原删除的文件 步骤详解 1. 查看一下当前系统版本号,及文件系统格式 [root@localhost ~]# df -T Filesystem Type 1 ...