Debugging in MPLABIDE

For C and ASSEMBLY users to post questions and code snippets for programming in C and ASSEMBLY. And for any other C or ASM course related questions.

Moderators: Benj, Mods

Post Reply
Kumaran
Posts: 73
Joined: Tue Apr 08, 2008 5:23 pm
Been thanked: 1 time
Contact:

Debugging in MPLABIDE

Post by Kumaran »

I am getting following error message while I build the C program generated by flowcode in mplab IDe. I try to build it in mplab to check the program in debugging mode in actual target.
mplab ICD2 debugger is used.

MPLAB C18 v3.21 (demo)
Copyright 2000-2008 Microchip Technology Inc.
Days remaining until demo becomes feature limited: 58
H:\Rotary encoder\PortDFlicker.c:46:Warning [2002] unknown pragma 'CLOCK_FREQ'
H:\Rotary encoder\PortDFlicker.c:72:Error [1105] symbol 'adcon1' has not been defined
H:\Rotary encoder\PortDFlicker.c:72:Error [1101] lvalue required
H:\Rotary encoder\PortDFlicker.c:73:Error [1105] symbol 'ucfg' has not been defined
H:\Rotary encoder\PortDFlicker.c:73:Error [1101] lvalue required
H:\Rotary encoder\PortDFlicker.c:82:Error [1105] symbol 'trisc' has not been defined
H:\Rotary encoder\PortDFlicker.c:82:Error [1105] symbol 'trisc' has not been defined
H:\Rotary encoder\PortDFlicker.c:82:Error [1101] lvalue required
H:\Rotary encoder\PortDFlicker.c:84:Error [1105] symbol 'portc' has not been defined
H:\Rotary encoder\PortDFlicker.c:84:Error [1105] symbol 'portc' has not been defined
H:\Rotary encoder\PortDFlicker.c:84:Error [1101] lvalue required
H:\Rotary encoder\PortDFlicker.c:86:Error [1105] symbol 'portc' has not been defined
H:\Rotary encoder\PortDFlicker.c:86:Error [1105] symbol 'portc' has not been defined
H:\Rotary encoder\PortDFlicker.c:86:Error [1101] lvalue required
H:\Rotary encoder\PortDFlicker.c:86:Warning [2055] expression is always false
H:\Rotary encoder\PortDFlicker.c:91:Error [1105] symbol 'trisc' has not been defined
H:\Rotary encoder\PortDFlicker.c:91:Error [1105] symbol 'trisc' has not been defined
H:\Rotary encoder\PortDFlicker.c:91:Error [1101] lvalue required
H:\Rotary encoder\PortDFlicker.c:93:Error [1105] symbol 'portc' has not been defined
H:\Rotary encoder\PortDFlicker.c:93:Error [1105] symbol 'portc' has not been defined
H:\Rotary encoder\PortDFlicker.c:93:Error [1101] lvalue required
H:\Rotary encoder\PortDFlicker.c:95:Error [1105] symbol 'portc' has not been defined
H:\Rotary encoder\PortDFlicker.c:95:Error [1105] symbol 'portc' has not been defined
H:\Rotary encoder\PortDFlicker.c:95:Error [1101] lvalue required
H:\Rotary encoder\PortDFlicker.c:95:Warning [2056] expression is always true
H:\Rotary encoder\PortDFlicker.c:104:Error [1105] symbol 'trisd' has not been defined
H:\Rotary encoder\PortDFlicker.c:104:Error [1105] symbol 'trisd' has not been defined
H:\Rotary encoder\PortDFlicker.c:104:Error [1101] lvalue required
Halting build on first failure as requested.


Thanks for your answers

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Debugging in MPLABIDE

Post by Benj »

Hello

Im afraid that BoostC is not directly compatible with microchips C18 compiler.

Do a block find and replace to change the following values.

adcon1 -> ADCON1
ucfg -> UCFG
trisc -> TRISC
portc -> PORTC
trisd -> TRISD

Your program should hopefully compile correctly after these mods.

Kumaran
Posts: 73
Joined: Tue Apr 08, 2008 5:23 pm
Been thanked: 1 time
Contact:

Re: Debugging in MPLABIDE

Post by Kumaran »

No effect in this chage

H:\Rotary encoder\PortDFlicker.c:46:Warning [2002] unknown pragma 'CLOCK_FREC'
H:\Rotary encoder\PortDFlicker.c:72:Error [1105] symbol 'ADCON1' has not been defined
H:\Rotary encoder\PortDFlicker.c:72:Error [1101] lvalue required
H:\Rotary encoder\PortDFlicker.c:73:Error [1105] symbol 'UCFG' has not been defined
H:\Rotary encoder\PortDFlicker.c:73:Error [1101] lvalue required
H:\Rotary encoder\PortDFlicker.c:82:Error [1105] symbol 'TRISC' has not been defined
H:\Rotary encoder\PortDFlicker.c:82:Error [1105] symbol 'TRISC' has not been defined
H:\Rotary encoder\PortDFlicker.c:82:Error [1101] lvalue required
H:\Rotary encoder\PortDFlicker.c:84:Error [1105] symbol 'PORTC' has not been defined
H:\Rotary encoder\PortDFlicker.c:84:Error [1105] symbol 'PORTC' has not been defined
H:\Rotary encoder\PortDFlicker.c:84:Error [1101] lvalue required
H:\Rotary encoder\PortDFlicker.c:86:Error [1105] symbol 'PORTC' has not been defined
H:\Rotary encoder\PortDFlicker.c:86:Error [1105] symbol 'PORTC' has not been defined
H:\Rotary encoder\PortDFlicker.c:86:Error [1101] lvalue required
H:\Rotary encoder\PortDFlicker.c:86:Warning [2055] expression is always false
H:\Rotary encoder\PortDFlicker.c:91:Error [1105] symbol 'TRISC' has not been defined
H:\Rotary encoder\PortDFlicker.c:91:Error [1105] symbol 'TRISC' has not been defined
H:\Rotary encoder\PortDFlicker.c:91:Error [1101] lvalue required
H:\Rotary encoder\PortDFlicker.c:93:Error [1105] symbol 'PORTC' has not been defined
H:\Rotary encoder\PortDFlicker.c:93:Error [1105] symbol 'PORTC' has not been defined
H:\Rotary encoder\PortDFlicker.c:93:Error [1101] lvalue required
H:\Rotary encoder\PortDFlicker.c:95:Error [1105] symbol 'PORTC' has not been defined
H:\Rotary encoder\PortDFlicker.c:95:Error [1105] symbol 'PORTC' has not been defined
H:\Rotary encoder\PortDFlicker.c:95:Error [1101] lvalue required
H:\Rotary encoder\PortDFlicker.c:95:Warning [2056] expression is always true
H:\Rotary encoder\PortDFlicker.c:104:Error [1105] symbol 'TRISD' has not been defined
H:\Rotary encoder\PortDFlicker.c:104:Error [1105] symbol 'TRISD' has not been defined
H:\Rotary encoder\PortDFlicker.c:104:Error [1101] lvalue required

Kumaran
Posts: 73
Joined: Tue Apr 08, 2008 5:23 pm
Been thanked: 1 time
Contact:

Re: Debugging in MPLABIDE

Post by Kumaran »

I have solved some of the error by includind p18cxxx.h. finaly I got onr more error to solve.

Error - could not find definition of symbol 'delay_ms' in file 'C:\Program Files\Matrix Multimedia\Flowcode V3\fcd\PortDFlicker.o'.
Errors : 1


Thanks for your advice

Kumaran
Posts: 73
Joined: Tue Apr 08, 2008 5:23 pm
Been thanked: 1 time
Contact:

Re: Debugging in MPLABIDE

Post by Kumaran »

I tried to build using .asm generated using flowcode. in that case also, I amgetting an following error

Error - could not find definition of symbol 'main' in file 'C:\MCC18\lib/c018i.o'.
Errors : 1


Thanks for your answers

Kumaran
Posts: 73
Joined: Tue Apr 08, 2008 5:23 pm
Been thanked: 1 time
Contact:

Re: Debugging in MPLABIDE

Post by Kumaran »


Post Reply