• AVR Freaks

AnsweredHot!Undefined symbols

Author
phoenix_don
New Member
  • Total Posts : 26
  • Reward points : 0
  • Joined: 2009/08/05 16:53:49
  • Location: 0
  • Status: offline
2019/03/20 13:55:48 (permalink)
0

Undefined symbols

There doesn't appear to be any problems with the compiler (it reports no errors), but I get this error 500 when I try to run the compiler/linker in XC8:
:0: error: (500) undefined symbols:
_LATB(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _WPUB(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _TMR0H(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _TMR1H(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _TMR3H(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _TMR0L(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _TMR1L(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _TMR3L(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _RCREG(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _RCSTA(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _TRISB(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _TXREG(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _SPBRG(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _TXSTA(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _EEADR(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _T0CON(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _T1CON(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _T3CON(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _ADRES(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _ADCON0(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _ADCON1(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _ADCON2(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _EECON2(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _PIE1bits(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _PIR1bits(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _IPR1bits(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _PIR2bits(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _LATAbits(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _LATCbits(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _RCONbits(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _EEDATA(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _SSPBUF(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _TABLAT(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _TBLPTR(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _SSPCON1(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _TRISAbits(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _RCSTAbits(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _TRISCbits(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _PORTBbits(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _TXSTAbits(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _T0CONbits(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _T1CONbits(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _T3CONbits(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _SSPSTAT(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _SSPCON1bits(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _INTCON2bits(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _INTCON3bits(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _BAUDCONbits(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _SSPSTATbits(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _ADCON0bits(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _EECON1bits(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _WDTCONbits(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj) _INTCONbits(dist/Grey_Box_Logger/production\Logger_Code.X.production.obj)
 
Now all of these SHOULD have been defined in the device.h file (p18F25k20). I don't know where else the linker might be looking to not know where these registers are....
HELP
#1
NKurzman
A Guy on the Net
  • Total Posts : 17494
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: online
Re: Undefined symbols 2019/03/20 14:01:06 (permalink) ☼ Best Answerby phoenix_don 2019/03/20 14:40:03
+2 (2)
did you include <xc.h> ?
#2
phoenix_don
New Member
  • Total Posts : 26
  • Reward points : 0
  • Joined: 2009/08/05 16:53:49
  • Location: 0
  • Status: offline
Re: Undefined symbols 2019/03/20 14:40:48 (permalink)
-1 (1)
Yes, it is included as "xc.h" since it is in the local source directory.
#3
jack@kksound
code tags!
  • Total Posts : 3198
  • Reward points : 0
  • Joined: 2014/05/14 10:03:19
  • Location: 0
  • Status: online
Re: Undefined symbols 2019/03/20 14:40:55 (permalink)
+1 (1)
As always SHOW YOUR CODE! Really makes this easier.
AND this makes little sense:
There doesn't appear to be any problems with the compiler (it reports no errors), but I get this error 500 when I try to run the compiler/linker in XC8:

"Reports no errors" but you "get this error" ????
#4
phoenix_don
New Member
  • Total Posts : 26
  • Reward points : 0
  • Joined: 2009/08/05 16:53:49
  • Location: 0
  • Status: offline
Re: Undefined symbols 2019/03/20 14:43:03 (permalink)
0
This error is reported from the linker, not the compiler.
#5
qhb
Superb Member
  • Total Posts : 9998
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: offline
Re: Undefined symbols 2019/03/20 14:45:21 (permalink)
+2 (2)
phoenix_don
Yes, it is included as "xc.h" since it is in the local source directory.

WHY is xc.h in the local directory?
It is normally located in the compiler's include folder, and you should not edit it or move it.
 

Nearly there...
#6
NKurzman
A Guy on the Net
  • Total Posts : 17494
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: online
Re: Undefined symbols 2019/03/20 16:26:43 (permalink)
+1 (1)
#include <xc.h>  will include several other include files based on the command line provided by MPLabX.
Are you using a Normal install of XC8 and building from MPLabX?  If not, then what are you doing?
And what version of MPLabX are you trying to do it with?
#7
phoenix_don
New Member
  • Total Posts : 26
  • Reward points : 0
  • Joined: 2009/08/05 16:53:49
  • Location: 0
  • Status: offline
Re: Undefined symbols 2019/03/21 13:48:38 (permalink)
0
Thanks to all for their suggestions. Changing the include to <xc.h> did make the program compile and link appropriately. However, I would caution all those advocates of the Microchip method to be aware of the following:
All the #include files mentioned in xc.h were included in the local file, so the compiler (and syntax checker) found no issues. The problem came up after the compile, during the linking process. None of the included files in xc.h had the absolute address of internal registers, so the values could not be mapped. Ergo, the xc.h file itself does not seem to be the answer directly, but there must be another file (pic18f25k20.h) that DOES have that information. Somehow, the location and implementation of this file is abetted by the indication that one is using the default location of the other includes, so the linker knows where to find it. When I have time, I will use the prior method of using xc.h in the local source directory,and include the pic18f25k20.h file to complete the link process. For now, I'm just going to be content with the compile operating 'correctly' with the default xc.h location.
If you're wondering why I'd like to keep all the files local, just think about how you're going to archive this when you're all done for the next generation to use. It's enough that I have to record the IDE and Compiler version, but also all the other files for this as well in different directories?
#8
qhb
Superb Member
  • Total Posts : 9998
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: offline
Re: Undefined symbols 2019/03/21 14:17:54 (permalink)
+1 (1)
The "other files" are all part of the "Compiler version".
You do seem to be going out of your way to make this more complicated than it needs to be.
 

Nearly there...
#9
jtemples
عُضْوٌ جَدِيد
  • Total Posts : 11209
  • Reward points : 0
  • Joined: 2004/02/13 12:31:19
  • Location: Southern California
  • Status: offline
Re: Undefined symbols 2019/03/21 14:54:32 (permalink)
+1 (1)
If you're wondering why I'd like to keep all the files local, just think about how you're going to archive this when you're all done for the next generation to use. It's enough that I have to record the IDE and Compiler version, but also all the other files for this as well in different directories?

 
You don't archive the VERSION of the tools, you archive the TOOLS.  Having a version number of a tool that can no longer be downloaded is worthless.  With the tools archived, you don't need to copy random files from the tools into your project.
#10
Jump to:
© 2019 APG vNext Commercial Version 4.5