I'm trying to compile some code for basic USB HID functionality. I'm using a PIC18F14K50 with MPLAB 8.43 and the Microchip C18 compiler.
I'm using some standard files from Microchip's website. Here is my C file and here is my header file.
I'm getting the following error when I build:
Executing: "C:\Program Files\Microchip\mplabc18\v3.40\bin\mplink.exe" /p18F14K50 /l"C:\MCC18\lib" /k"C:\MCC18\bin\LKR" "usb_function_hid.o" "usb_device.o" "enumeration.o" "usb_descriptors.o" /u_CRUNTIME /u_DEBUG /z__MPLAB_BUILD=1 /z__MPLAB_DEBUG=1 /o"C:\LPCUSBDK_Labs\Lab1_files\output\Project Lab 1.cof" /M"C:\LPCUSBDK_Labs\Lab1_files\output\Project Lab 1.map" /W
MPLINK 4.40, Linker
Device Database Version 1.3
Copyright (c) 1998-2011 Microchip Technology Inc.
Error - could not find definition of symbol 'HIDDescriptor1' in file './usb_function_hid.o'.
Errors : 1
Link step failed.
The HIDDescriptor1
symbol appears in 2 places in the code: PasteBin line 173 of the C file and PasteBin line 356 of the header file.
This code comes straight from Microchip. I'm not sure why it wouldn't be linking. I think either it's designed for another version of the compiler, I'm missing some external dependency, or I'm missing some compiler/linker switches.
Any ideas on what I need to do to get this to build?