首页 文章

使用XC8接收有关PIC18上的plib I2C功能的“未定义符号”错误

提问于
浏览
0

我似乎已经完成了它 . 我有一个与此非常相似的问题:Receiving "undefined symbols" error with XC8 concerning plib I2C functions

问题是,上一篇文章的建议操作是更改为PIC18以解决问题...我已经在使用PIC18了!

我的设置如下:

MPLAB:产品版本:MPLAB X IDE v3.50 Java:1.8.0_91; Java HotSpot(TM)64位服务器VM 25.91-b14运行时:Java(TM)SE运行时环境1.8.0_91-b14系统:在amd64上运行的Windows 7版本6.1; CP1252; en_CA(mplab)

XC8:版本1.40

还安装了:peripheral-libraries-for-pic18-v2.00rc3-windows-installer.exe

这是“违规代码”...请注意,这不会在我的main.c文件中生成任何错误(没有以红色下划线的函数) . 起初,I2C函数以红色加下划线,但是当我在代码开头添加#define I2C_V1时,它自行解决了......但是我确实一直收到以下错误:

:0:错误:(499)未定义符号:_OpenI2C(dist / default / production \ Lab2.X.production.obj)

这是代码:

void readTemp()
{
    int TEMP = 0;
    char temp2= 0;

    // code pour le i2c
    unsigned char temperature, addr, cmd_byte, status;
    TRISBbits.RB0 =1;
    TRISBbits.RB1 =1;


    SSPADD = 0x31; // 100KHz Fosc = ?? Mhz
    OpenI2C(MASTER,SLEW_OFF);

    cmd_byte=1; //start with measure
    StartI2C();
    // while ( SSPCON2bits.SEN ); // wait until start condition is over
    // already included in StartI2C()
    addr = 0x90; // adresse du TC74 modèle A0 en écriture
    status = WriteI2C(addr);
    while (SSPCON2bits.ACKSTAT); //Bit 6 (I2C_V4 routine does not ackn.
    IdleI2C(); // while ( ( SSPCON & 0x1F ) || ( SSPSTATbits.R_W ) )
    WriteI2C(0x00);
    while (SSPCON2bits.ACKSTAT); // wait for the acknowledge from slave
    IdleI2C();
    RestartI2C(); // keep the line and avoid others to grab the line
    while ( SSPCON2bits.RSEN ); // wait until re-start condition is over
    IdleI2C();
    addr = 0x91; // adresse du TC74 modèle A0 en lecture
    WriteI2C(addr);
    while (SSPCON2bits.ACKSTAT);
    IdleI2C();
    temperature = getcI2C();
    IdleI2C();
    RestartI2C();
    addr = 0x91; // adresse du TC74 modèle A0 en lecture
    WriteI2C(addr);
    while (SSPCON2bits.ACKSTAT);
    IdleI2C();
    temperature = getcI2C();
    IdleI2C();
    StopI2C();
    CloseI2C();
    temp2 = temperature;
    //return temperature;


     TXREG = temp2;
     LATDbits.LATD4 = 0; 

}

这是日志(详细):

make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'C:/Users/Marchear/MPLABXProjects/Lab2.X'
make  -f nbproject/Makefile-default.mk dist/default/production/Lab2.X.production.hex
make[2]: Entering directory 'C:/Users/Marchear/MPLABXProjects/Lab2.X'
"C:\Program Files (x86)\Microchip\xc8\v1.40\bin\xc8.exe" --pass1  --chip=18LF4550 -Q -G  --double=24 --float=24 --emi=wordwrite --opt=+asm,+asmfile,-speed,+space,-debug --addrqual=ignore --mode=free -P -N255 -I"../../../../Program Files (x86)/Microchip/xc8/v1.40/include/plib" -V --warn=-3 --asmlist -DXPRJ_default=default  --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,-download,+config,+clib,+plib   --output=-mcof,+elf:multilocs --stack=compiled:auto:auto:auto "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s"    -obuild/default/production/config_bits.p1  config_bits.c 
"C:\Program Files (x86)\Microchip\xc8\v1.40\bin\xc8.exe" --pass1  --chip=18LF4550 -Q -G  --double=24 --float=24 --emi=wordwrite --opt=+asm,+asmfile,-speed,+space,-debug --addrqual=ignore --mode=free -P -N255 -I"../../../../Program Files (x86)/Microchip/xc8/v1.40/include/plib" -V --warn=-3 --asmlist -DXPRJ_default=default  --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,-download,+config,+clib,+plib   --output=-mcof,+elf:multilocs --stack=compiled:auto:auto:auto "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s"    -obuild/default/production/main.p1  main.c 
:: warning: (1370) peripheral library support is not available for the 18LF4550
C:\Program Files (x86)\Microchip\xc8\v1.40\bin\cpp.exe @C:\Users\Marchear\AppData\Local\Temp\cpp_sdm0.cmd [ -W-3 "--edf=C:\Program Files (x86)\Microchip\xc8\v1.40\dat\en_msgs.txt" -SP3,3,3,3,3,3,3 -DXPRJ_default=default "-I../../../../Program Files (x86)/Microchip/xc8/v1.40/include/plib" "-IC:\Program Files (x86)\Microchip\xc8\v1.40\include" -E1 -D_OMNI_CODE_ -D__STACK_COMPILED=1 -D__STACK_HYBRID=2 -D__STACK_REENTRANT=4 -D__STACK=__STACK_COMPILED -D__XC -D__XC8 -D__XC__ -D__XC8__ -D__XC8_VERSION=1400 -DHI_TECH_C -D_HTC_VER_MAJOR_=10 -D_HTC_VER_MINOR_=40 -D_HTC_VER_PLVL_=0 -D_HTC_VER_PATCH_=48 -D_HTC_EDITION_=0 -D__OPTIMIZE_SIZE__ -D__OPTIMIZE_SPACE__ -D__OPTIM_FLAGS=0x3 -D__OPTIM_NONE=0x0 -D__OPTIM_ASM=0x1 -D__OPTIM_ASMFILE=0x2 -D__OPTIM_SPEED=0x20000 -D__OPTIM_SPACE=0x40000 -D__OPTIM_SIZE=0x40000 -D__OPTIM_DEBUG=0x80000 -D__OPTIM_INVARIANT=0x100000 -N255 -D__18LF4550 -D__18LF4550__ -D_18LF4550 -D__XC -D__XC8 -S1,2,2,3,4,3,3 -D_ROMSIZE=32768 -D_RAMSIZE=2048 -D_EEPROMSIZE=256 -D_FLASH_ERASE_SIZE=64 -D_FLASH_WRITE_SIZE=32 -D_ERRATA_TYPES=0 -D_18F4550_FAMILY_ -D__TRADITIONAL18__=1 -D__PICC18__ -D_MPC_ -D_PIC18 config_bits.c build/default/production\config_bits.pre ]
C:\Program Files (x86)\Microchip\xc8\v1.40\bin\cpp.exe @C:\Users\Marchear\AppData\Local\Temp\cpp_sdm0.cmd [ -W-3 "--edf=C:\Program Files (x86)\Microchip\xc8\v1.40\dat\en_msgs.txt" -SP3,3,3,3,3,3,3 -DXPRJ_default=default "-I../../../../Program Files (x86)/Microchip/xc8/v1.40/include/plib" "-IC:\Program Files (x86)\Microchip\xc8\v1.40\include" -Lgcc -E1 --dep_nosys -D_OMNI_CODE_ -D__STACK_COMPILED=1 -D__STACK_HYBRID=2 -D__STACK_REENTRANT=4 -D__STACK=__STACK_COMPILED -D__XC -D__XC8 -D__XC__ -D__XC8__ -D__XC8_VERSION=1400 -DHI_TECH_C -D_HTC_VER_MAJOR_=10 -D_HTC_VER_MINOR_=40 -D_HTC_VER_PLVL_=0 -D_HTC_VER_PATCH_=48 -D_HTC_EDITION_=0 -D__OPTIMIZE_SIZE__ -D__OPTIMIZE_SPACE__ -D__OPTIM_FLAGS=0x3 -D__OPTIM_NONE=0x0 -D__OPTIM_ASM=0x1 -D__OPTIM_ASMFILE=0x2 -D__OPTIM_SPEED=0x20000 -D__OPTIM_SPACE=0x40000 -D__OPTIM_SIZE=0x40000 -D__OPTIM_DEBUG=0x80000 -D__OPTIM_INVARIANT=0x100000 -N255 -D__18LF4550 -D__18LF4550__ -D_18LF4550 -D__XC -D__XC8 -S1,2,2,3,4,3,3 -D_ROMSIZE=32768 -D_RAMSIZE=2048 -D_EEPROMSIZE=256 -D_FLASH_ERASE_SIZE=64 -D_FLASH_WRITE_SIZE=32 -D_ERRATA_TYPES=0 -D_18F4550_FAMILY_ -D__TRADITIONAL18__=1 -D__PICC18__ -D_MPC_ -D_PIC18 config_bits.c build/default/production\config_bits.d ]
:: warning: (1370) peripheral library support is not available for the 18LF4550
C:\Program Files (x86)\Microchip\xc8\v1.40\bin\cpp.exe @C:\Users\Marchear\AppData\Local\Temp\cpp_scbg.cmd [ -W-3 "--edf=C:\Program Files (x86)\Microchip\xc8\v1.40\dat\en_msgs.txt" -SP3,3,3,3,3,3,3 -DXPRJ_default=default "-I../../../../Program Files (x86)/Microchip/xc8/v1.40/include/plib" "-IC:\Program Files (x86)\Microchip\xc8\v1.40\include" -E1 -D_OMNI_CODE_ -D__STACK_COMPILED=1 -D__STACK_HYBRID=2 -D__STACK_REENTRANT=4 -D__STACK=__STACK_COMPILED -D__XC -D__XC8 -D__XC__ -D__XC8__ -D__XC8_VERSION=1400 -DHI_TECH_C -D_HTC_VER_MAJOR_=10 -D_HTC_VER_MINOR_=40 -D_HTC_VER_PLVL_=0 -D_HTC_VER_PATCH_=48 -D_HTC_EDITION_=0 -D__OPTIMIZE_SIZE__ -D__OPTIMIZE_SPACE__ -D__OPTIM_FLAGS=0x3 -D__OPTIM_NONE=0x0 -D__OPTIM_ASM=0x1 -D__OPTIM_ASMFILE=0x2 -D__OPTIM_SPEED=0x20000 -D__OPTIM_SPACE=0x40000 -D__OPTIM_SIZE=0x40000 -D__OPTIM_DEBUG=0x80000 -D__OPTIM_INVARIANT=0x100000 -N255 -D__18LF4550 -D__18LF4550__ -D_18LF4550 -D__XC -D__XC8 -S1,2,2,3,4,3,3 -D_ROMSIZE=32768 -D_RAMSIZE=2048 -D_EEPROMSIZE=256 -D_FLASH_ERASE_SIZE=64 -D_FLASH_WRITE_SIZE=32 -D_ERRATA_TYPES=0 -D_18F4550_FAMILY_ -D__TRADITIONAL18__=1 -D__PICC18__ -D_MPC_ -D_PIC18 main.c build/default/production\main.pre ]
C:\Program Files (x86)\Microchip\xc8\v1.40\bin\p1.exe @C:\Users\Marchear\AppData\Local\Temp\p1_sdm0.cmd [ -W-3 "--edf=C:\Program Files (x86)\Microchip\xc8\v1.40\dat\en_msgs.txt" --cmode=htc -Tunsupported,s -Tdeprecated -Taddress,i -QCu,0,const -QN_,0,near -QI_,0,interrupt -QS_,0,persistent -QT_,0,inline -QQ,0,__pack -QR_,0,reentrant -QR_,0,software -QJ_,0,nonreentrant -QJ_,0,compiled -QU,0,__discrete -Q00,1512,__invariant -Q00,1512,__stable -QE_,0,eeprom -QL_,0,low_priority -QH_,0,high_priority -QW_s,0,bank0 -QX_s,0,bank1 -QY_s,0,bank2 -QZ_s,0,bank3 -QB_,0,bdata -QFu_,0,far -v -N255 -E1 -S -u -fp "--cfgdata=C:\Program Files (x86)\Microchip\xc8\v1.40\dat\cfgdata\18lf4550.cfgdata" "--cfgmap=C:\Program Files (x86)\Microchip\xc8\v1.40\dat\cfgmap\18lf4550.cfgmap" -Gstrings,const -M -B -Y -r -J build/default/production\config_bits.pre build/default/production\config_bits.p1 C:\Users\Marchear\AppData\Local\Temp\sdm0.5 ]
C:\Program Files (x86)\Microchip\xc8\v1.40\bin\cpp.exe @C:\Users\Marchear\AppData\Local\Temp\cpp_scbg.cmd [ -W-3 "--edf=C:\Program Files (x86)\Microchip\xc8\v1.40\dat\en_msgs.txt" -SP3,3,3,3,3,3,3 -DXPRJ_default=default "-I../../../../Program Files (x86)/Microchip/xc8/v1.40/include/plib" "-IC:\Program Files (x86)\Microchip\xc8\v1.40\include" -Lgcc -E1 --dep_nosys -D_OMNI_CODE_ -D__STACK_COMPILED=1 -D__STACK_HYBRID=2 -D__STACK_REENTRANT=4 -D__STACK=__STACK_COMPILED -D__XC -D__XC8 -D__XC__ -D__XC8__ -D__XC8_VERSION=1400 -DHI_TECH_C -D_HTC_VER_MAJOR_=10 -D_HTC_VER_MINOR_=40 -D_HTC_VER_PLVL_=0 -D_HTC_VER_PATCH_=48 -D_HTC_EDITION_=0 -D__OPTIMIZE_SIZE__ -D__OPTIMIZE_SPACE__ -D__OPTIM_FLAGS=0x3 -D__OPTIM_NONE=0x0 -D__OPTIM_ASM=0x1 -D__OPTIM_ASMFILE=0x2 -D__OPTIM_SPEED=0x20000 -D__OPTIM_SPACE=0x40000 -D__OPTIM_SIZE=0x40000 -D__OPTIM_DEBUG=0x80000 -D__OPTIM_INVARIANT=0x100000 -N255 -D__18LF4550 -D__18LF4550__ -D_18LF4550 -D__XC -D__XC8 -S1,2,2,3,4,3,3 -D_ROMSIZE=32768 -D_RAMSIZE=2048 -D_EEPROMSIZE=256 -D_FLASH_ERASE_SIZE=64 -D_FLASH_WRITE_SIZE=32 -D_ERRATA_TYPES=0 -D_18F4550_FAMILY_ -D__TRADITIONAL18__=1 -D__PICC18__ -D_MPC_ -D_PIC18 main.c build/default/production\main.d ]
del C:\Users\Marchear\AppData\Local\Temp\cpp_sdm0.cmd
del C:\Users\Marchear\AppData\Local\Temp\p1_sdm0.cmd
C:\Program Files (x86)\Microchip\xc8\v1.40\bin\p1.exe @C:\Users\Marchear\AppData\Local\Temp\p1_scbg.cmd [ -W-3 "--edf=C:\Program Files (x86)\Microchip\xc8\v1.40\dat\en_msgs.txt" --cmode=htc -Tunsupported,s -Tdeprecated -Taddress,i -QCu,0,const -QN_,0,near -QI_,0,interrupt -QS_,0,persistent -QT_,0,inline -QQ,0,__pack -QR_,0,reentrant -QR_,0,software -QJ_,0,nonreentrant -QJ_,0,compiled -QU,0,__discrete -Q00,1512,__invariant -Q00,1512,__stable -QE_,0,eeprom -QL_,0,low_priority -QH_,0,high_priority -QW_s,0,bank0 -QX_s,0,bank1 -QY_s,0,bank2 -QZ_s,0,bank3 -QB_,0,bdata -QFu_,0,far -v -N255 -E1 -S -u -fp "--cfgdata=C:\Program Files (x86)\Microchip\xc8\v1.40\dat\cfgdata\18lf4550.cfgdata" "--cfgmap=C:\Program Files (x86)\Microchip\xc8\v1.40\dat\cfgmap\18lf4550.cfgmap" -Gstrings,const -M -B -Y -r -J build/default/production\main.pre build/default/production\main.p1 C:\Users\Marchear\AppData\Local\Temp\scbg.5 ]
del C:\Users\Marchear\AppData\Local\Temp\cpp_scbg.cmd
del C:\Users\Marchear\AppData\Local\Temp\p1_scbg.cmd
"C:\Program Files (x86)\Microchip\xc8\v1.40\bin\xc8.exe"  --chip=18LF4550 -G -mdist/default/production/Lab2.X.production.map  --double=24 --float=24 --emi=wordwrite --opt=+asm,+asmfile,-speed,+space,-debug --addrqual=ignore --mode=free -P -N255 -I"../../../../Program Files (x86)/Microchip/xc8/v1.40/include/plib" -V --warn=-3 --asmlist -DXPRJ_default=default  --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,-download,+config,+clib,+plib --output=-mcof,+elf:multilocs --stack=compiled:auto:auto:auto "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s"      --memorysummary dist/default/production/memoryfile.xml -odist/default/production/Lab2.X.production.elf  build/default/production/config_bits.p1 build/default/production/main.p1     
Microchip MPLAB XC8 C Compiler (Free Mode) V1.40
Build date: Nov 30 2016
Part Support Version: 1.40
Copyright (C) 2016 Microchip Technology Inc.
License type: Node Configuration

:: warning: (1370) peripheral library support is not available for the 18LF4550
:: warning: (1273) Omniscient Code Generation not available in Free mode
C:\Program Files (x86)\Microchip\xc8\v1.40\bin\cgpic18.exe @C:\Users\Marchear\AppData\Local\Temp\cgpic18_sa1k.cmd [ -W-3 "--edf=C:\Program Files (x86)\Microchip\xc8\v1.40\dat\en_msgs.txt" --cmode=htc -Og9 -q -E1 -w9 --ivtinit=none "-CC:\Program Files (x86)\Microchip\xc8\v1.40\dat\picc-18.ini" -PPIC18LF4550 -PMS0:code:0@CODE=00h-07FFFh -PMS0:code:0@CONST=00h-07FFFh -PMS0:code:0@SMALLCONST=0800h-08FFhx120 -PMS0:code:0@MEDIUMCONST=0800h-07FFFh -PMS1:data:8@COMRAM=01h-05Fh -PMS1:data:0@ABS1=00h-07FFh -PMS1:data:0@BIGRAM=01h-07FFh -PMS1:data:0@RAM=060h-0FFh,0100h-01FFhx7 -PMS1:data:8000@BANK0=060h-0FFh -PMS1:data:10000@BANK1=0100h-01FFh -PMS1:data:20000@BANK2=0200h-02FFh -PMS1:data:40000@BANK3=0300h-03FFh -PMS1:data:0@BANK4=0400h-04FFh -PMS1:data:0@BANK5=0500h-05FFh -PMS1:data:0@BANK6=0600h-06FFh -PMS1:data:0@BANK7=0700h-07FFh -PMS1:data:0@SFR=0F60h-0FFFh -PMS4:config:0@CONFIG=0300000h-030000Dh -PMS3:eedata:0@EEDATA=0F00000h-0F000FFh -PMS5:idloc:0@IDLOC=0200000h-0200007h "--cfgdata=C:\Program Files (x86)\Microchip\xc8\v1.40\dat\cfgdata\18lf4550.cfgdata" --cfgprefix=__CFG_ --stack=compiled -MLFSROK -MEMI_WORD -Pcp=2 -Perrata=0x0 -Pramsize=0x7FF -fp -AC:\Users\Marchear\AppData\Local\Temp\sa1k. --funcdat=C:\Users\Marchear\AppData\Local\Temp\sa1k.1 --addrqual=ignore --runtime=init --runtime=clear --undefints=ignore build/default/production/config_bits.p1 build/default/production/main.p1 "C:\Program Files (x86)\Microchip\xc8\v1.40\lib\pic18-stdlib-htc-d24-f24-sz.lpp" "C:\Program Files (x86)\Microchip\xc8\v1.40\lib\pic18-setjmp.lpp" ]
C:\Program Files (x86)\Microchip\xc8\v1.40\bin\cgpic18.exe @C:\Users\Marchear\AppData\Local\Temp\cgpic18_sa1k.cmd [ -W-3 "--edf=C:\Program Files (x86)\Microchip\xc8\v1.40\dat\en_msgs.txt" --cmode=htc -q -E1 -Ddist/default/production\Lab2.X.production.sdb --interrupts=6 --ivtinit=none "-CC:\Program Files (x86)\Microchip\xc8\v1.40\dat\picc-18.ini" -PPIC18LF4550 -PMS0:code:0@CODE=00h-07FFFh -PMS0:code:0@CONST=00h-07FFFh -PMS0:code:0@SMALLCONST=0800h-08FFhx120 -PMS0:code:0@MEDIUMCONST=0800h-07FFFh -PMS1:data:8@COMRAM=01h-05Fh -PMS1:data:0@ABS1=00h-07FFh -PMS1:data:0@BIGRAM=01h-07FFh -PMS1:data:0@RAM=060h-0FFh,0100h-01FFhx7 -PMS1:data:8000@BANK0=060h-0FFh -PMS1:data:10000@BANK1=0100h-01FFh -PMS1:data:20000@BANK2=0200h-02FFh -PMS1:data:40000@BANK3=0300h-03FFh -PMS1:data:0@BANK4=0400h-04FFh -PMS1:data:0@BANK5=0500h-05FFh -PMS1:data:0@BANK6=0600h-06FFh -PMS1:data:0@BANK7=0700h-07FFh -PMS1:data:0@SFR=0F60h-0FFFh -PMS4:config:0@CONFIG=0300000h-030000Dh -PMS3:eedata:0@EEDATA=0F00000h-0F000FFh -PMS5:idloc:0@IDLOC=0200000h-0200007h "--cfgdata=C:\Program Files (x86)\Microchip\xc8\v1.40\dat\cfgdata\18lf4550.cfgdata" --cfgprefix=__CFG_ --stack=compiled -MLFSROK -MEMI_WORD -Pcp=2 -Perrata=0x0 -Pramsize=0x7FF -AC:\Users\Marchear\AppData\Local\Temp\sa1k. --funcdat=C:\Users\Marchear\AppData\Local\Temp\sa1k.1 --addrqual=ignore --runtime=init --runtime=clear --undefints=ignore build/default/production/config_bits.p1 build/default/production/main.p1 "C:\Program Files (x86)\Microchip\xc8\v1.40\lib\pic18-stdlib-htc-d24-f24-sz.lpp" "C:\Program Files (x86)\Microchip\xc8\v1.40\lib\pic18-setjmp.lpp" ]
C:\Program Files (x86)\Microchip\xc8\v1.40\bin\aspic18.exe @C:\Users\Marchear\AppData\Local\Temp\aspic18_sa1k.cmd [ -W-3 "--edf=C:\Program Files (x86)\Microchip\xc8\v1.40\dat\en_msgs.txt" --cmode=htc -E1 -o "-CC:\Program Files (x86)\Microchip\xc8\v1.40\dat\picc-18.ini" -ver=V1.40 -ldist/default/production\Lab2.X.production.lst --opt= -18LF4550 --errata=0 --comdiv=95 -no_pa -odist/default/production\Lab2.X.production.obj C:\Users\Marchear\AppData\Local\Temp\sa1k. ]
C:\Program Files (x86)\Microchip\xc8\v1.40\bin\aspic18.exe @C:\Users\Marchear\AppData\Local\Temp\aspic18_sa1k.cmd [ -W-3 "--edf=C:\Program Files (x86)\Microchip\xc8\v1.40\dat\en_msgs.txt" --cmode=htc -E1 "-CC:\Program Files (x86)\Microchip\xc8\v1.40\dat\picc-18.ini" -ver=V1.40 --opt= -18LF4550 --errata=0 --comdiv=95 -no_pa -oC:\Users\Marchear\AppData\Local\Temp\sa1k.obj C:\Users\Marchear\AppData\Local\Temp\sa1k.as ]
C:\Program Files (x86)\Microchip\xc8\v1.40\bin\hlink.exe @C:\Users\Marchear\AppData\Local\Temp\hlink_sa1k.cmd [ -W-3 "--edf=C:\Program Files (x86)\Microchip\xc8\v1.40\dat\en_msgs.txt" -cs -h+dist/default/production\Lab2.X.production.sym --cmf=dist/default/production\Lab2.X.production.cmf -z -w9 --norlf -Q18LF4550 -oC:\Users\Marchear\AppData\Local\Temp\sa1k.2 -Mdist/default/production/Lab2.X.production.map -E1 -ver=XC8#PRO##V1.40 -ACODE=00h-07FFFh -ACONST=00h-07FFFh -ASMALLCONST=0800h-08FFhx120 -AMEDIUMCONST=0800h-07FFFh -ACOMRAM=01h-05Fh -AABS1=00h-07FFh -ABIGRAM=01h-07FFh -ARAM=060h-0FFh,0100h-01FFhx7 -ABANK0=060h-0FFh -ABANK1=0100h-01FFh -ABANK2=0200h-02FFh -ABANK3=0300h-03FFh -ABANK4=0400h-04FFh -ABANK5=0500h-05FFh -ABANK6=0600h-06FFh -ABANK7=0700h-07FFh -ASFR=0F60h-0FFFh -preset_vec=00h,intcode,intcodelo,powerup,init -pramtop=0800h -psmallconst=SMALLCONST -pmediumconst=MEDIUMCONST -pconst=CONST -AFARRAM=00h-00h -ACONFIG=0300000h-030000Dh -pconfig=CONFIG -AIDLOC=0200000h-0200007h -pidloc=IDLOC -AEEDATA=0F00000h-0F000FFh -peeprom_data=EEDATA -prdata=COMRAM,nvrram=COMRAM,nvbit=COMRAM,rbss=COMRAM,rbit=COMRAM -pfarbss=FARRAM,fardata=FARRAM,nvFARRAM=FARRAM -pintsave_regs=BIGRAM,bigbss=BIGRAM,bigdata=BIGRAM -pbss=RAM -pidata=CODE,irdata=CODE,ibigdata=CODE,ifardata=CODE C:\Users\Marchear\AppData\Local\Temp\sa1k.obj dist/default/production\Lab2.X.production.obj ]
:0: error: (499) undefined symbol:
    _OpenI2C(dist/default/production\Lab2.X.production.obj) 
del C:\Users\Marchear\AppData\Local\Temp\sa1k.
del C:\Users\Marchear\AppData\Local\Temp\sa1k.1
del C:\Users\Marchear\AppData\Local\Temp\sa1k.2
del C:\Users\Marchear\AppData\Local\Temp\cgpic18_sa1k.cmd
del C:\Users\Marchear\AppData\Local\Temp\aspic18_sa1k.cmd
del C:\Users\Marchear\AppData\Local\Temp\sa1k.as
del C:\Users\Marchear\AppData\Local\Temp\sa1k.obj
del C:\Users\Marchear\AppData\Local\Temp\hlink_sa1k.cmd
(908) exit status = 1
nbproject/Makefile-default.mk:141: recipe for target 'dist/default/production/Lab2.X.production.hex' failed
make[2]: Leaving directory 'C:/Users/Marchear/MPLABXProjects/Lab2.X'
nbproject/Makefile-default.mk:84: recipe for target '.build-conf' failed
make[1]: Leaving directory 'C:/Users/Marchear/MPLABXProjects/Lab2.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make[2]: *** [dist/default/production/Lab2.X.production.hex] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2

我已检查链接器选项中的“外设库中的链接”框 . 此外,如果它在某个地方的整个日志中丢失,我会得到以下警告:

:: warning: (1370) peripheral library support is not available for the 18LF4550

我已经调查了它,但找不到任何关于我可能遗失/做错的信息 .

至于一些额外的背景,我正在教授关于微处理器和PIC编程的课程,而且我正在接收去年参加该课程的其他人的所有内容 . 显然,I2C模块去年工作了......我正在与我的同事核实,看看从那以后发生了什么变化 . 也许是编译器版本 .

想一想,我安装完库后没有重新启动计算机...不要认为它应该有所作为,但我会尝试 .

谢谢您的帮助 :)

1 回答

  • 2

    好的,所以在永远搜索之后,我的同事通知我,如果将设备设置为PIC18LF4550,则库不起作用 . 您必须在项目选项中将器件设置为PIC18F4550,否则它将无法与I2C外设库(可能还有其他未经测试)配合使用 .

相关问题