อยากจะรบกวนถามเรื่อง Error ของ MPlab C18 หน่อยครับ
Enchamp |
Code ผมตามนี้นะครับ #include <p18f458.h> #pragma config OSC = HS #pragma config WDT = OFF #pragma config LVP = OFF #include "xlcd.h" #include "xlcd.c" #include <delays.h> #define XLCDCursorOnBlinkOn() XLCDCommand(0x0F) #define XLCDCursorOnBlinkOff() XLCDCommand(0x0E) #define XLCDDisplayOnCursorOff() XLCDCommand(0x0C) #define XLCDDisplayOff() XLCDCommand(0x08) #define XLCDDisplayMoveLeft() XLCDCommand(0x18) #define XLCDDisplayMoveRight() XLCDCommand(0x1C) rom const char name[] = "HELLO WORLD" ; void XLCDDelay15ms (void) { int i; for(i=0;i<10000;i++) { Nop(); } return; } void XLCDDelay4ms (void) { int i; for(i=0;i<2500;i++) { Nop(); } return; } void XLCD_Delay500ns (void) { Nop(); Nop(); Nop(); } void XLCDDelay (void) { int i; for(i=0;i<1000;i++) { Nop(); } return; } void main (void) { ADCON1 = 0x07; XLCDInit(); XLCDCommand(0x80); XLCDPutRomString(name); while(1); return; } โดยที่มันมีError - Debug build of project `E:\Project\Microcontroller\work\LCD1.mcp' started. Preprocessor symbol `__DEBUG' is defined. Wed Oct 31 01:28:01 2012 ---------------------------------------------------------------------- Clean: Deleting intermediary and output files. Clean: Deleted file "E:\Project\Microcontroller\work\LCD1.o". Clean: Deleted file "E:\Project\Microcontroller\work\xlcd.o". Clean: Done. Executing: "C:\MCC18\mcc18\bin\mcc18.exe" -p=18F458 /i"C:\MCC18\mcc18\h" "LCD1.c" -fo="LCD1.o" -D__DEBUG -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- MPLAB C18 v3.02 (feature limited) Copyright 1999-2005 Microchip Technology Inc. This version of MPLAB C18 does not support the extended mode and will not perform all optimizations. To purchase a full copy of MPLAB C18, please contact your local distributor or visit buy.microchip.com. E:\Project\Microcontroller\work\LCD1.c:57:Warning [2066] type qualifier mismatch in assignment Executing: "C:\MCC18\mcc18\bin\mcc18.exe" -p=18F458 /i"C:\MCC18\mcc18\h" "xlcd.c" -fo="xlcd.o" -D__DEBUG -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- MPLAB C18 v3.02 (feature limited) Copyright 1999-2005 Microchip Technology Inc. This version of MPLAB C18 does not support the extended mode and will not perform all optimizations. To purchase a full copy of MPLAB C18, please contact your local distributor or visit buy.microchip.com. Executing: "C:\MCC18\mcc18\bin\mplink.exe" /l"C:\MCC18\mcc18\lib" /k"C:\MCC18\mcc18\bin\lkr" "C:\MCC18\mcc18\bin\lkr\18f458.lkr" "LCD1.o" "xlcd.o" "C:\MCC18\mcc18\lib\p18f458.lib" /z__MPLAB_BUILD=1 /z__MPLAB_DEBUG=1 /o"LCD1.cof" /M"LCD1.map" /W MPLINK 4.02, Linker Copyright (c) 2006 Microchip Technology Inc. Error - unknown switch: /z__MPLAB_BUILD=1 Errors : 1 Link step failed. ---------------------------------------------------------------------- Debug build of project `E:\Project\Microcontroller\work\LCD1.mcp' failed. Preprocessor symbol `__DEBUG' is defined. Wed Oct 31 01:28:02 2012 ---------------------------------------------------------------------- BUILD FAILED อยากจะรบกวนช่วยบอกวิธีแก้ไขให้หน่อยครับ |
