编译错误1

1

错误提示:

liubo.S:1: Error: bad expression

liubo.S:1: Error: junk at end of line, first unrecognized character is `0'

错误:

.equ mem_control_address,   #0x48000000               @宏定义,存储控制器起始地址

.equ sdram_address,         #0x30000000               @宏定义,SDRAM的起始地址

改正:

.equ mem_control_address,   0x48000000               @宏定义,存储控制器起始地址

.equ sdram_address,         0x30000000               @宏定义,SDRAM的起始地址

错误原因:

多写了一个#

 

 

2

错误提示:

liubo.S:23: Error: junk at end of line, first unrecognized character is `*'

错误:

@**********************************

@关看门狗@

**********

错误改正:

@**********************************

@关看门狗@

@**********

错误原因:

注释前忘了加@

 

3、

错误提示:

liubo.S:29: Error: immediate expression requires a # prefix -- `mov pc,1r'

错误:

 mov  pc, 1r 

错误改正:

Mov pc, lr   

错误原因:

代码中l写成了一

 

 

4

错误提示:

liubo.S:66: Error: bad instruction `copy_steppingstone4k_to_sdram '

错误:

copy_steppingstone4k_to_SDRAM :

错误改正:

copy_steppingstone4k_to_SDRAM: 

错误原因:

后面的冒号写成了中文输入法下的,应该为英文下的,英文的与前面字母间隔小些

 

 

5

错误提示:

liubo.S:70: Error: junk at end of line, first unrecognized character is `1'

错误:

1

错误改正:

1:

错误原因:

同样是因为冒号写成了中文的,所以无法识别是代码段

 

 

6

错误提示:

/opt/FriendlyARM/toolschain/4.4.3/bin/.arm-none-linux-gnueabi-ld: warning: cannot find entry symbol _start; defaulting to 30000000

liubo_S.o: In function `on_sdram':

(.text+0x14): undefined reference to `main'

liubo_c.o: In function `on_sdram':

(.text+0x14): undefined reference to `main'

错误:

arm-linux-gcc  -c  -o  liubo_S.o  liubo.S 

arm-linux-gcc  -c  -o  liubo_S.o  liubo.S 

错误改正:

arm-linux-gcc  -c  -o  liubo_S.o  liubo.S 

arm-linux-gcc  -c  -o  liubo_S.o  liubo.c

错误原因:

第二个写错了,应该是c文件

 

7

错误提示:

liubo.c:14: error: stray '\357' in program

错误:

/ /***********

错误改正:

//***********

错误原因:

同样是输入法,中文输入法下的/之间间隔很大,而且gvim中没有颜色提示,在英文输入法时//有颜色提示间隔小。

 

8、

调用库函数math.h时出现错误

因为linux中, pow 函数定义在 libm.so中,不像一般DevC++或TC是放在C语言的/lib下,所以, C无法在连接时, 找到相对应的库来连接。

解决方法:

gcc  filename.c  -lm -o  filename

 

posted on 2015-01-19 20:48  放.逐  阅读(2167)  评论(0)    收藏  举报

导航