打印
[PIC®/AVR®/dsPIC®产品]

急!急!急!MAPLAB+PICC18编译遇到的问题

[复制链接]
5243|7
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
erics0708|  楼主 | 2015-8-22 13:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
小弟初学PIC单片机编程,我自己写的程序用MPLAB C18可以通过,后来改PICC18编译器就不通过,我按提示查了好久错误都没有问题,我不知道问提出在哪里,求大神帮忙看一下。
以下是MPLAB C18编译结果:
MPLINK 4.45, Linker
Device Database Version 1.10
Copyright (c) 1998-2011 Microchip Technology Inc.
Errors    : 0

MP2HEX 4.45, COFF to HEX File Converter
Copyright (c) 1998-2011 Microchip Technology Inc.
Errors    : 0

Loaded D:\taorong\taorong.cof.
----------------------------------------------------------------------
Debug build of project `D:\taorong\taorong.mcp' succeeded.
Language tool versions: mpasmwin.exe v5.47, mplink.exe v4.45, mcc18.exe v3.44, mplib.exe v4.45
Preprocessor symbol `__DEBUG' is defined.
Sat Aug 22 13:17:35 2015
----------------------------------------------------------------------
BUILD SUCCEEDED



以下是PICC18编译结果:
Make: The target "D:\taorong\ST7920SPI.p1" is out of date.
Executing: "c:\PICC18\bin\picc18.exe" --pass1 D:\taorong\ST7920SPI.c -q --chip=18F4520 -P --runtime=default --opt=default -D__DEBUG=1 -g --asmlist "--errformat=Error   [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
Error   [372] D:\taorong\ST7920SPI.h; 20.47 "," expected
Error   [984] D:\taorong\AT24C02.h; 6.13 type redeclared
Error   [1098] D:\taorong\AT24C02.h; 6.13 conflicting declarations for variable "SSPIF" (c:\PICC18\include\pic18f4520.h:4129)
Error   [984] D:\taorong\AT24C02.h; 7.11 type redeclared
Error   [1098] D:\taorong\AT24C02.h; 7.11 conflicting declarations for variable "SEN" (c:\PICC18\include\pic18f4520.h:4093)
Warning [374] D:\taorong\ST7920SPI.c; 9.11 missing basic type; int assumed
Error   [314] D:\taorong\ST7920SPI.c; 9.11 ";" expected
Error   [192] D:\taorong\ST7920SPI.c; 169.7 undefined identifier "TAB1"
Error   [981] D:\taorong\ST7920SPI.c; 169.17 pointer required
Error   [981] D:\taorong\ST7920SPI.c; 169.17 pointer required
Error   [372] D:\taorong\ST7920SPI.c; 354.46 "," expected
Make: The target "D:\taorong\main.p1" is out of date.
Executing: "c:\PICC18\bin\picc18.exe" --pass1 D:\taorong\main.c -q --chip=18F4520 -P --runtime=default --opt=default -D__DEBUG=1 -g --asmlist "--errformat=Error   [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
Error   [372] D:\taorong\ST7920SPI.h; 20.47 "," expected
Error   [984] D:\taorong\AT24C02.h; 6.13 type redeclared
Error   [1098] D:\taorong\AT24C02.h; 6.13 conflicting declarations for variable "SSPIF" (c:\PICC18\include\pic18f4520.h:4129)
Error   [984] D:\taorong\AT24C02.h; 7.11 type redeclared
Error   [1098] D:\taorong\AT24C02.h; 7.11 conflicting declarations for variable "SEN" (c:\PICC18\include\pic18f4520.h:4093)
Warning [228] D:\taorong\main.c; 29.16 illegal character (0xD4)
Warning [358] D:\taorong\main.c; 29.32 illegal conversion of pointer to integer
Error   [187] D:\taorong\main.c; 29.32 too few function arguments
Warning [228] D:\taorong\main.c; 31.16 illegal character (0xB1)
Warning [358] D:\taorong\main.c; 31.30 illegal conversion of pointer to integer
Error   [187] D:\taorong\main.c; 31.30 too few function arguments
Warning [228] D:\taorong\main.c; 32.16 illegal character (0xD4)
Warning [358] D:\taorong\main.c; 32.26 illegal conversion of pointer to integer
Error   [187] D:\taorong\main.c; 32.26 too few function arguments
Warning [358] D:\taorong\main.c; 33.18 illegal conversion of pointer to integer
Error   [187] D:\taorong\main.c; 33.18 too few function arguments
Make: The target "D:\taorong\init.p1" is out of date.
Executing: "c:\PICC18\bin\picc18.exe" --pass1 D:\taorong\init.c -q --chip=18F4520 -P --runtime=default --opt=default -D__DEBUG=1 -g --asmlist "--errformat=Error   [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
Error   [372] D:\taorong\ST7920SPI.h; 20.47 "," expected
Error   [984] D:\taorong\AT24C02.h; 6.13 type redeclared
Error   [1098] D:\taorong\AT24C02.h; 6.13 conflicting declarations for variable "SSPIF" (c:\PICC18\include\pic18f4520.h:4129)
Error   [984] D:\taorong\AT24C02.h; 7.11 type redeclared
Error   [1098] D:\taorong\AT24C02.h; 7.11 conflicting declarations for variable "SEN" (c:\PICC18\include\pic18f4520.h:4093)
Warning [335] D:\taorong\init.c; 10.1 unknown pragma "code"
Error   [195] D:\taorong\init.c; 14.1 expression syntax
Error   [312] D:\taorong\init.c; 15.1 ";" expected
Warning [335] D:\taorong\init.c; 16.1 unknown pragma "code"
Warning [335] D:\taorong\init.c; 17.1 unknown pragma "interrupt"
Make: The target "D:\taorong\delay.p1" is out of date.
Executing: "c:\PICC18\bin\picc18.exe" --pass1 D:\taorong\delay.c -q --chip=18F4520 -P --runtime=default --opt=default -D__DEBUG=1 -g --asmlist "--errformat=Error   [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
Error   [372] D:\taorong\ST7920SPI.h; 20.47 "," expected
Error   [984] D:\taorong\AT24C02.h; 6.13 type redeclared
Error   [1098] D:\taorong\AT24C02.h; 6.13 conflicting declarations for variable "SSPIF" (c:\PICC18\include\pic18f4520.h:4129)
Error   [984] D:\taorong\AT24C02.h; 7.11 type redeclared
Error   [1098] D:\taorong\AT24C02.h; 7.11 conflicting declarations for variable "SEN" (c:\PICC18\include\pic18f4520.h:4093)
Make: The target "D:\taorong\ZLG7289.p1" is out of date.
Executing: "c:\PICC18\bin\picc18.exe" --pass1 D:\taorong\ZLG7289.c -q --chip=18F4520 -P --runtime=default --opt=default -D__DEBUG=1 -g --asmlist "--errformat=Error   [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
Error   [372] D:\taorong\ST7920SPI.h; 20.47 "," expected
Error   [984] D:\taorong\AT24C02.h; 6.13 type redeclared
Error   [1098] D:\taorong\AT24C02.h; 6.13 conflicting declarations for variable "SSPIF" (c:\PICC18\include\pic18f4520.h:4129)
Error   [984] D:\taorong\AT24C02.h; 7.11 type redeclared
Error   [1098] D:\taorong\AT24C02.h; 7.11 conflicting declarations for variable "SEN" (c:\PICC18\include\pic18f4520.h:4093)

********** Build failed! **********


双击第一项错误是
void LCD_wrstr(unsigned char x_add, const rom char *s);/*写入要显示的字符串*/
我不知道哪里错误了,还有picc编译器需要注意那些问题。求大神指导!!!!

沙发
yklstudent| | 2015-8-22 13:52 | 只看该作者
英文提示看不懂?那也可以百度翻译啊

使用特权

评论回复
板凳
erics0708|  楼主 | 2015-8-22 13:57 | 只看该作者
yklstudent 发表于 2015-8-22 13:52
英文提示看不懂?那也可以百度翻译啊

Error   [372] D:\taorong\ST7920SPI.h; 20.47 "," expected
麻烦大神帮我翻译下这句啥意思。文化不高是在没办法。

使用特权

评论回复
地板
yklstudent| | 2015-8-22 20:18 | 只看该作者
erics0708 发表于 2015-8-22 13:57
Error   [372] D:\taorong\ST7920SPI.h; 20.47 "," expected
麻烦大神帮我翻译下这句啥意思。文化不高是 ...

不会百度嘛?新手

使用特权

评论回复
5
xyz549040622| | 2015-8-23 07:04 | 只看该作者
一个预期的,号,应该是你多了一个逗号吧

使用特权

评论回复
6
millenniumm| | 2015-8-23 11:46 | 只看该作者
在此位置期望有一个逗号,这个函数声明使得编译器认为在const rom后面应该有一个逗号,产生这个错误的原因可能是rom在c18里是关键字,但在picc里面不是,编译器把它当成变量名了,解决方法是把rom删掉。

使用特权

评论回复
7
erics0708|  楼主 | 2015-8-25 01:14 | 只看该作者
已经解决了确实是去掉rom就可以了!!非常感谢!!

使用特权

评论回复
8
BraveLiu| | 2017-6-1 11:08 | 只看该作者
有PICC18 9.8版本的没?麻烦发到我的邮箱545018331@qq.com.谢谢。

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

2

主题

5

帖子

0

粉丝