Log in

View Full Version : missing old_port


stephenthe1
16-02-2005, 20:34
MPLINK 3.90, Linker
Copyright (c) 2004 Microchip Technology Inc.
Error - could not find definition of symbol 'Old_Port_B' in file 'C:\1008\build\interrupts.o'.
Errors : 1


what's wrong here?

ace123
16-02-2005, 22:29
What you just got is a linker error. Linker errors generally talk about variables or functions that are not found anywhere and are often cryptic. Usually your best way to solve them is to use the "Find in project files..." option and search for the variable or function in question and find out how they are used.

Usually they result from typos or missing files. If you see a warning like "Implicit definition of function" then that means that you do not have a "header" file with the fuction delcared in it. This often results in such linker errors.

In this case, just declare an int variable called "Old_Port_B" at the top of interrupts.c so that the linker will find it.
int Old_Port_B;
Just make sure that you declare it outside of a function because the linker does not look in local variables.

Alan Anderson
17-02-2005, 10:09
MPLINK 3.90, Linker
Copyright (c) 2004 Microchip Technology Inc.
Error - could not find definition of symbol 'Old_Port_B' in file 'C:\1008\build\interrupts.o'.
Errors : 1


what's wrong here?
Search your project for references to that symbol. Here's the clue in the interrupts.c file:

Old_Port_B = PORTB; // initialize the Old_Port_B variable (in user_routines_fast.c)

Immediately after all the #includes in user_routines.fast.c, you should have this:

unsigned char Old_Port_B = 0xFF;// state of port b the last time
// this function was called

It's there in the downloaded frc_interrupts example. You probably copied what you thought was important from it into your own files, and missed this one.