Re: 請問 C18移植XC8 MCC或Harmony及PIC32與PC WIFI控制資料傳輸

作者 a45899 於 2018年01月31日 16:26:42
楊老師, 板主及大家好!
有關 MCP6V01 demo code, 目前我暫時解決的方法是將所有 #include xx.c 和 xx.h 都加上絕對路徑, 並在 MPLAB v8.92, 使用C18 v3.47的編譯器, LIB, LINK, 才能順利編譯.
但是將 Project 的Select Language Toolsuite 設定成 XC8 的 compiler, Lib, Link, 就出現無法編譯的訊息

Executing: "C:\Program Files (x86)\Microchip\xc8\v1.45\bin\mcc18.exe" -p=18F2550 /i"C:\Work\MCP6V01TCdemo" "usb9.c" -fo="C:\Work\MCP6V01TCdemo\autofiles\usb9.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
usb9.c: USBStdGetDscHandler()
149: pSrc.bRom = *(USB_CD_Ptr+SetupPkt.bDscIndex);
^ (359) illegal conversion between pointer types (warning)
rom pointer to const rom unsigned char -> pointer to rom unsigned char
154: pSrc.bRom = *(USB_SD_Ptr+SetupPkt.bDscIndex);
^ (359) illegal conversion between pointer types (warning)
rom pointer to const rom unsigned char -> pointer to rom unsigned char
Executing: "C:\Program Files (x86)\Microchip\xc8\v1.45\bin\mcc18.exe" -p=18F2550 /i"C:\Work\MCP6V01TCdemo" "usbdsc.c" -fo="C:\Work\MCP6V01TCdemo\autofiles\usbdsc.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
usbdsc.c:
71: rom struct{ USB_CFG_DSC cd01; USB_INTF_DSC i00a00; USB_HID_DSC hid_i00a00; USB_EP_DSC ep01i_i00a00; USB_EP_DSC ep01o_i00a00;} cfg01={
(984) type redeclared ^
(1098) conflicting declarations for variable "cfg01" (usbdsc.c:71) ^
(908) exit status = 1
(908) exit status = 1
Halting build on first failure as requested.

來自: http://www.microchip.com.tw/newbb/viewtopic.php?forum=7&topic_id=22194&post_id=77734