SiriusHardware
New Member
After several years of successfully writing moderately complex embedded programs for PIC16C series using a combination of MPLAB / Hitech C I now need to use the PIC18F452 for a project. As Hitech C doesn't support the '18' parts I have been trying to get C18/MPLAB up and running.
MPLAB C18 version: 3.42. MPLAB: V8.00
The c program is LEDS.C from within the C18 directory.
The project has been defined for the PIC18F452, which is also manually selected in configure/select device.
In the project wizard I selected the MPLAB C18 toolsuite: I added the file LEDS.C to the source part of the project, and I have added the linker file P18F452_g.lkr to the Linker part of the project. I assume that's correct so far?
When I attempt to build this project the following error occurs:
Error - could not find definition of symbol 'OpenTimer0' in file 'C:\picprojects\leds.o'.
The 'c' file includes the following lines:
#include <p18cxxx.h>
#include <timers.h>
'p18cxxx.h' references the specific definitions file 'P18f452.h'
The function 'OpenTimer0' -is- defined in the 'timers.h.' file.
The 'toolsuite locations' point to the relevant .exe files and directories in C:\Program Files\Microchip\mplabc18\v3.42\...etc.
I can't understand why, when the processor type has already been specified in the project wizard, everything else (linker file, header file, etc) isn't set up automatically. Isn't that what a Wizard is for?
Following one suggestion, I tried adding 'p18f452.lib' to the 'libs' section of the project. This simply led to it being unable to find a different definition ('STATUS'). I've removed 'p18f452.lib from the project again, so the situation is as outlined above.
Looking around the net I see variations on this question repeated over and over again, always seemingly with a different answer. It suggests that there is something fundamentally wrong with this compiler.
How do I go about getting this program to compile?
MPLAB C18 version: 3.42. MPLAB: V8.00
The c program is LEDS.C from within the C18 directory.
The project has been defined for the PIC18F452, which is also manually selected in configure/select device.
In the project wizard I selected the MPLAB C18 toolsuite: I added the file LEDS.C to the source part of the project, and I have added the linker file P18F452_g.lkr to the Linker part of the project. I assume that's correct so far?
When I attempt to build this project the following error occurs:
Error - could not find definition of symbol 'OpenTimer0' in file 'C:\picprojects\leds.o'.
The 'c' file includes the following lines:
#include <p18cxxx.h>
#include <timers.h>
'p18cxxx.h' references the specific definitions file 'P18f452.h'
The function 'OpenTimer0' -is- defined in the 'timers.h.' file.
The 'toolsuite locations' point to the relevant .exe files and directories in C:\Program Files\Microchip\mplabc18\v3.42\...etc.
I can't understand why, when the processor type has already been specified in the project wizard, everything else (linker file, header file, etc) isn't set up automatically. Isn't that what a Wizard is for?
Following one suggestion, I tried adding 'p18f452.lib' to the 'libs' section of the project. This simply led to it being unable to find a different definition ('STATUS'). I've removed 'p18f452.lib from the project again, so the situation is as outlined above.
Looking around the net I see variations on this question repeated over and over again, always seemingly with a different answer. It suggests that there is something fundamentally wrong with this compiler.
How do I go about getting this program to compile?
Last edited: