Page 1 of 1

Error: :0: error: (499) undefined symbol:

PostPosted: Thu Jul 24, 2014 5:27 pm
by SLTom992
I continue to get this error on compile. All of the .c and .h files show as parts of the project now.

There are no errors in the .c files that I can find. This error appears to be in both .h files

The Display.h file contains nothing but the Fonts which have been used before without problems.

The Detector.h contains nothing but the function prototypes for functions that are in the Display.c file.

The top of the Detector.c contains:

#include "Display.h"

The function prototypes in Display.h look like:

void OLED_Init();

If I try to call a function from Detector to Display I get a real error. It seems to me that the compiler is not using the prototypes to link to the other file.

Is there something incorrect in the way I'm expecting the prototypes to work or is there an MPLAB X peculiarity that I'm missing? When I originally had linking errors it turned out to be a MPLAB X problem with having extra non=project files in the project folder. I've double checked that this time. And I can't see any possible sources of error.

Re: Error: :0: error: (499) undefined symbol:

PostPosted: Thu Jul 24, 2014 6:14 pm
by jtemples
It's going to be very difficult for anyone to diagnose your problem just based on a description. Remove code that isn't relevant, then zip up the project and attach it.

Re: Error: :0: error: (499) undefined symbol:

PostPosted: Thu Jul 24, 2014 9:34 pm
by SLTom992
There are some 1400 lines of code. What would be relevant?

Re: Error: :0: error: (499) undefined symbol:

PostPosted: Thu Jul 24, 2014 9:41 pm
by jtemples
If you are ok with posting all of it, that's fine.

Re: Error: :0: error: (499) undefined symbol:

PostPosted: Fri Jul 25, 2014 4:40 am
by AussieSusan
The alternative is for you to remove sections (I tend to comment them out) of the code and re-compile/re-link to see if you still get the error. When you get to a "main()" function with a few lines that call the function in question and you still get the error, then you will have a small example of code that we can use.
However, if you find that the error goes away at some point while doing this, then you will have at least located a smaller section of code that contains the problem.
I must admit that this sounds like the .C code does not contain the functions that the .h files mentions or that the .c files makes reference to some other external symbol that is not included in the link.
Susan

Re: Error: :0: error: (499) undefined symbol:

PostPosted: Fri Jul 25, 2014 5:19 am
by ric
This appears to have been resolved at http://www.microchip.com/forums/FindPost/810521
Note, the clue was the next line in the build log, that wasn't posted here.