2017-01-08 115 views
0

我一直試圖解決整個晚上的問題,而我似乎無法完成。我遇到了一個和這個非常相似的問題:Receiving "undefined symbols" error with XC8 concerning plib I2C functions收到PIC18上與plib I2C函數有關的XC8錯誤「undefined symbols」錯誤

問題是,上一篇文章的推薦操作是更改爲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版

還安裝:外設庫換PIC18-v2.00rc3窗口-Installer.exe的

這裏是 「有問題的代碼」 ...請注意,這不會在我的main.c文件中生成任何錯誤(沒有以紅色下劃線的函數)。起初,I2C功能以紅色標出,但是當我在代碼開始處添加#define I2C_V1時,它自行解決了......但是我仍然收到以下錯誤:

:0:error: (499)未定義的符號: _OpenI2C(DIST /默認/生產\ 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:[email protected]=00h-07FFFh -PMS0:code:[email protected]=00h-07FFFh -PMS0:code:[email protected]=0800h-08FFhx120 -PMS0:code:[email protected]=0800h-07FFFh -PMS1:data:[email protected]=01h-05Fh -PMS1:data:[email protected]=00h-07FFh -PMS1:data:[email protected]=01h-07FFh -PMS1:data:[email protected]=060h-0FFh,0100h-01FFhx7 -PMS1:data:[email protected]=060h-0FFh -PMS1:data:[email protected]=0100h-01FFh -PMS1:data:[email protected]=0200h-02FFh -PMS1:data:[email protected]=0300h-03FFh -PMS1:data:[email protected]=0400h-04FFh -PMS1:data:[email protected]=0500h-05FFh -PMS1:data:[email protected]=0600h-06FFh -PMS1:data:[email protected]=0700h-07FFh -PMS1:data:[email protected]=0F60h-0FFFh -PMS4:config:[email protected]=0300000h-030000Dh -PMS3:eedata:[email protected]=0F00000h-0F000FFh -PMS5:idloc:[email protected]=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:[email protected]=00h-07FFFh -PMS0:code:[email protected]=00h-07FFFh -PMS0:code:[email protected]=0800h-08FFhx120 -PMS0:code:[email protected]=0800h-07FFFh -PMS1:data:[email protected]=01h-05Fh -PMS1:data:[email protected]=00h-07FFh -PMS1:data:[email protected]=01h-07FFh -PMS1:data:[email protected]=060h-0FFh,0100h-01FFhx7 -PMS1:data:[email protected]=060h-0FFh -PMS1:data:[email protected]=0100h-01FFh -PMS1:data:[email protected]=0200h-02FFh -PMS1:data:[email protected]=0300h-03FFh -PMS1:data:[email protected]=0400h-04FFh -PMS1:data:[email protected]=0500h-05FFh -PMS1:data:[email protected]=0600h-06FFh -PMS1:data:[email protected]=0700h-07FFh -PMS1:data:[email protected]=0F60h-0FFFh -PMS4:config:[email protected]=0300000h-030000Dh -PMS3:eedata:[email protected]=0F00000h-0F000FFh -PMS5:idloc:[email protected]=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模塊去年工作...我正在與我的同事覈對,看看自那時以來發生了什麼變化。也許是編譯器版本。

想想吧,我沒有重新啓動我的電腦後,我安裝了庫...不認爲這應該有所作爲,但我會嘗試反正。

謝謝您的幫助:)

+0

您可能需要手動安裝傳統外設庫,因爲它不再作爲XC8的默認設置。 http://www.microchip.com/mplab/compilers,在下載選項卡中向下滾動到「Legacy Peripheral Libraries」。 – Unimportant

回答

1

好了,永遠找下去之後,我的同事通知我,如果你設置該設備作爲PIC18LF4550庫不起作用。您必須在項目選項中將器件設置爲PIC18F4550,否則將無法與I2C外設庫(可能還有其他器件未經測試)配合使用。