打印

C18 编译

[复制链接]
2991|5
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
hufa123|  楼主 | 2012-5-16 15:52 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
主函数#include<p18f87k90.h>
#include<i2c.h>
//***************************************************
void main(void)
{
  while(1)
  {

  }
}
编译出现问题一卡车
Executing: "C:\Program Files\Microchip\mplabc18\v3.41\bin\mcc18.exe" -p=18F87J90 /i"C:\Program Files\Microchip\mplabc18\v3.41\h" "SRC\main.c" -fo="main.o" -D__DEBUG -w3 -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
C:\Program Files\Microchip\mplabc18\v3.41\h\p18f87j90.h:15:Error [1109] type mismatch in redeclaration of 'PADCFG1bits'
C:\Program Files\Microchip\mplabc18\v3.41\h\p18f87j90.h:43:Error [1109] type mismatch in redeclaration of 'CTMUCONLbits'
C:\Program Files\Microchip\mplabc18\v3.41\h\p18f87j90.h:118:Error [1109] type mismatch in redeclaration of 'RTCCFGbits'
C:\Program Files\Microchip\mplabc18\v3.41\h\p18f87j90.h:119:Error [1109] type mismatch in redeclaration of 'RCSTA2'
C:\Program Files\Microchip\mplabc18\v3.41\h\p18f87j90.h:154:Error [1109] type mismatch in redeclaration of 'RCSTA2bits'
C:\Program Files\Microchip\mplabc18\v3.41\h\p18f87j90.h:155:Error [1109] type mismatch in redeclaration of 'TXSTA2'
C:\Program Files\Microchip\mplabc18\v3.41\h\p18f87j90.h:186:Error [1109] type mismatch in redeclaration of 'TXSTA2bits'
C:\Program Files\Microchip\mplabc18\v3.41\h\p18f87j90.h:187:Error [1109] type mismatch in redeclaration of 'TXREG2'
C:\Program Files\Microchip\mplabc18\v3.41\h\p18f87j90.h:188:Error [1109] type mismatch in redeclaration of 'RCREG2'
C:\Program Files\Microchip\mplabc18\v3.41\h\p18f87j90.h:189:Error [1109] type mismatch in redeclaration of 'SPBRG2'
C:\Program Files\Microchip\mplabc18\v3.41\h\p18f87j90.h:190:Error [1109] type mismatch in redeclaration of 'CCP2CON'
C:\Program Files\Microchip\mplabc18\v3.41\h\p18f87j90.h:209:Error [1109] type mismatch in redeclaration of 'CCP2CONbits'
C:\Program Files\Microchip\mplabc18\v3.41\h\p18f87j90.h:210:Error [1109] type mismatch in redeclaration of 'ECCP2CON'
C:\Program Files\Microchip\mplabc18\v3.41\h\p18f87j90.h:229:Error [1109] type mismatch in redeclaration of 'ECCP2CONbits'
C:\Program Files\Microchip\mplabc18\v3.41\h\p18f87j90.h:230:Error [1109] type mismatch in redeclaration of 'CCPR2'
C:\Program Files\Microchip\mplabc18\v3.41\h\p18f87j90.h:231:Error [1109] type mismatch in redeclaration of 'CCPR2L'
C:\Program Files\Microchip\mplabc18\v3.41\h\p18f87j90.h:232:Error [1109] type mismatch in redeclaration of 'CCPR2H'
C:\Program Files\Microchip\mplabc18\v3.41\h\p18f87j90.h:252:Error [1109] type mismatch in redeclaration of 'CCP1CONbits'
C:\Program Files\Microchip\mplabc18\v3.41\h\p18f87j90.h:272:Error [1109] type mismatch in redeclaration of 'ECCP1CONbits'
C:\Program Files\Microchip\mplabc18\v3.41\h\p18f87j90.h:301:Error [1109] type mismatch in redeclaration of 'LCDDATA5bits'
C:\Program Files\Microchip\mplabc18\v3.41\h\p18f87j90.h:337:Error [1109] type mismatch in redeclaration of 'LCDDATA6bits'
C:\Program Files\Microchip\mplabc18\v3.41\h\p18f87j90.h:367:Error [1109] type mismatch in redeclaration of 'LCDDATA7bits'
C:\Program Files\Microchip\mplabc18\v3.41\h\p18f87j90.h:393:Error [1109] type mismatch in redeclaration of 'LCDDATA8bits'
C:\Program Files\Microchip\mplabc18\v3.41\h\p18f87j90.h:419:Error [1109] type mismatch in redeclaration of 'LCDDATA9bits'
C:\Program Files\Microchip\mplabc18\v3.41\h\p18f87j90.h:445:Error [1109] type mismatch in redeclaration of 'LCDDATA10bits'
Halting build on first failure as requested.


这个是哪个设置有问题,这个编译器第一次用,谢谢指点
沙发
yewuyi| | 2012-5-16 17:43 | 只看该作者
可能是#include<p18f87k90.h>

使用特权

评论回复
板凳
hufa123|  楼主 | 2012-5-17 09:00 | 只看该作者
这两个头文件都是编译器最基本文件,我在PCONFIG.H文件中把#iinclude<18cxxx.h>注释掉就行了,难道编译器版本有问题?我用的是3.41

使用特权

评论回复
地板
yewuyi| | 2012-5-17 13:23 | 只看该作者
这两个头文件都是编译器最基本文件,我在PCONFIG.H文件中把#iinclude注释掉就行了,难道编译器版本有问题?我用的是3.41
hufa123 发表于 2012-5-17 09:00


1、有无重复包含?
2、是否包含了根本没有的头文件?
3、所包含的头文件内容和你选择的芯片型号是否不一致?

使用特权

评论回复
5
kvdong| | 2012-5-17 15:34 | 只看该作者
重复包含了应该是。
一般情况下只 #include <pconfig.h> 就可以了

使用特权

评论回复
6
hufa123|  楼主 | 2012-5-18 16:19 | 只看该作者
3、所包含的头文件内容和你选择的芯片型号是否不一致?
正解,惭愧,芯片选错了:$

使用特权

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

本版积分规则

186

主题

393

帖子

2

粉丝