• AVR Freaks

AnsweredHot!Linker error 499: Undefined symbol on a symbol I've implemented exactly the way MCC does

Author
yasja
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2019/02/11 02:47:47
  • Location: 0
  • Status: offline
2020/09/25 03:18:26 (permalink)
0

Linker error 499: Undefined symbol on a symbol I've implemented exactly the way MCC does

 
Hi, I think I'm going insane.
I have a function that looks like this:
midi_isrs.h
#ifndef MIDI_ISRS_H
#define MIDI_ISRS_H

#ifdef __cplusplus
extern "C" {
#endif

void NoteOnHandler( void );

#ifdef __cplusplus
}
#endif

#endif /* MIDI_ISRS_H */

midi_isrs.c
#include "midi_isrs.h"
void NoteOnHandler( void ) {
    NOP(); // There's not actually a NOP here but you get the idea
}

main.c
#include "midi_isrs.h"
void MIDI_Initialize() {
    MIDI_SetInterruptHandler(MIDI_NOTE_ON, NoteOnHandler);
}
I hope man can do without copy pasting the body of MIDI_SetInterruptHandler( ... ) but if they can't I'm willing to share.
I have written this exactly the way MCC scaffolds interrupt code for things like the TMR0, with the only difference being that the MIDI_SetInterruptHandler takes two arguments to determine which interrupt needs to be set by means of an enum (uint8), because there's a lot of different MIDI events.
Trying to build this code results in
:0:: error: (499) undefined symbol:
    _NoteOnHandler(dist/default/production/core.X.production.o)
(908) exit status = 1
Is anyone willing to give me some advice on this?
 
I'm using XC8 v2.20 PRO on linux 5.8 and the project is targeted at a PIC18F45K50 if that's relevant.
 
Any help is appreciated, thanks!
#1
andersm
Super Member
  • Total Posts : 2842
  • Reward points : 0
  • Joined: 2012/10/07 14:57:44
  • Location: 0
  • Status: offline
Re: Linker error 499: Undefined symbol on a symbol I've implemented exactly the way MCC do 2020/09/25 09:10:58 (permalink) ☼ Best Answerby yasja 2020/09/25 10:49:19
+2 (2)
Is midi_isrs.c actually built and included in the project?
#2
du00000001
Just Some Member
  • Total Posts : 3978
  • Reward points : 0
  • Joined: 2016/05/03 13:52:42
  • Location: Germany
  • Status: offline
Re: Linker error 499: Undefined symbol on a symbol I've implemented exactly the way MCC do 2020/09/25 10:15:10 (permalink)
0
Why do you provide only a small snippet of the error message(s) instead of the whole text ?

PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
#3
NKurzman
A Guy on the Net
  • Total Posts : 18975
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: offline
Re: Linker error 499: Undefined symbol on a symbol I've implemented exactly the way MCC do 2020/09/25 10:30:42 (permalink) ☄ Helpfulby yasja 2020/09/25 10:55:14
+2 (2)
Is midi_isrs.c in the Project?
#4
yasja
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2019/02/11 02:47:47
  • Location: 0
  • Status: offline
Re: Linker error 499: Undefined symbol on a symbol I've implemented exactly the way MCC do 2020/09/25 10:53:05 (permalink)
+1 (1)
andersm
Is midi_isrs.c actually built and included in the project?


Turns out midi_isrs.h wasn't in the project. it only existed on disk. Apparently creating files in the file browser doesn't automatically add them to the project or something. I feel so stupid right now. Thank you so much.
#5
NKurzman
A Guy on the Net
  • Total Posts : 18975
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: offline
Re: Linker error 499: Undefined symbol on a symbol I've implemented exactly the way MCC do 2020/09/25 10:56:16 (permalink)
+3 (3)
.h files do not need to be in the project.  But it is convenient that they are.
.C files will not be compiled or linked if they are not in the Project.
 
Live and Learn.
#6
Jump to:
© 2020 APG vNext Commercial Version 4.5