C18 编译

[复制链接]
3496|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、所包含的头文件内容和你选择的芯片型号是否不一致?
kvdong 发表于 2012-5-17 15:34 | 显示全部楼层
重复包含了应该是。
一般情况下只 #include <pconfig.h> 就可以了
 楼主| hufa123 发表于 2012-5-18 16:19 | 显示全部楼层
3、所包含的头文件内容和你选择的芯片型号是否不一致?
正解,惭愧,芯片选错了:$
您需要登录后才可以回帖 登录 | 注册

本版积分规则

186

主题

393

帖子

2

粉丝
快速回复 在线客服 返回列表 返回顶部