Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   missing old_port (http://www.chiefdelphi.com/forums/showthread.php?t=34779)

stephenthe1 16-02-2005 20:34

missing old_port
 
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

Re: missing old_port
 
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.
Code:

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

Re: missing old_port
 
Quote:

Originally Posted by stephenthe1
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:
Code:

        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:
Code:

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.


All times are GMT -5. The time now is 07:32.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi