• AVR Freaks

AnsweredLinker Error when despite including .h files

Author
Ryan J.
New Member
  • Total Posts : 8
  • Reward points : 0
  • Joined: 2015/10/20 12:30:23
  • Location: 0
  • Status: offline
2017/07/13 12:46:08 (permalink)
0

Linker Error when despite including .h files

I'm modifying the Harmony example UDP server.  I'm integrating a 3rd party protocol stack to see if I can configure it to run BACnet IP.  I have updated the project include directories with the file path of the 3rd party stack and slowly started modifying the example "app.c" file.

When I include the proper header files to the example code and call structures and macro's defined in those header files the linker gives me the dreaded "undefined reference to: __" error.  The macro and struct that I am referencing are called in other .c files that do not raise this error.  Am I missing a step?  The example worked just fine prior to calling the structure and macro.

Development Board: PIC32MZ Ethernet Starter Kit
Harmony: 2.03b
Compiler: XC32 1.43
post edited by Ryan J. - 2017/07/13 13:27:22
#1
CinziaG
die fucking humans
  • Total Posts : 3145
  • Reward points : 0
  • Joined: 2016/12/07 14:20:36
  • Location: Wien
  • Status: offline
Re: Linker Error when despite including .h files 2017/07/13 13:05:54 (permalink)
5 (2)
Well, .H files have nothing to do with Linker Smile
They just add pre-processing stuff, variables definitions etc. If you get a linker error, you may be missing some .C file , a library or alike

in 2018 you signed for your annihilation. in 2019 it will come ;) I promise
my most wonderful creations here
https://www.youtube.com/c...dPFRvtwsbSTXp6Sk6azGOQ
#2
Ryan J.
New Member
  • Total Posts : 8
  • Reward points : 0
  • Joined: 2015/10/20 12:30:23
  • Location: 0
  • Status: offline
Re: Linker Error when despite including .h files 2017/07/13 13:20:20 (permalink)
0
Thanks @CinziaG,

The structure and macro that I am using are defined in the .H files that I included into the example "app.c" file.  I don't want to modify the stack code if at all possible.  I have verified that this stack works as written as I have had it running on a PIC32MX board previously.  The only difference is the stack was configured for serial communication and not ethernet.

The stack comes with working examples of the ethernet configuration (albeit on arduino) with no change to these headers.  Does this mean that I need to somehow tell the linker to include the .C files?
#3
CinziaG
die fucking humans
  • Total Posts : 3145
  • Reward points : 0
  • Joined: 2016/12/07 14:20:36
  • Location: Wien
  • Status: offline
Re: Linker Error when despite including .h files 2017/07/13 14:01:13 (permalink) ☼ Best Answerby Ryan J. 2017/07/13 14:21:59
0
Yeah, if I get this correctly you have to.
Basically you just add these files to your Project.

in 2018 you signed for your annihilation. in 2019 it will come ;) I promise
my most wonderful creations here
https://www.youtube.com/c...dPFRvtwsbSTXp6Sk6azGOQ
#4
Ryan J.
New Member
  • Total Posts : 8
  • Reward points : 0
  • Joined: 2015/10/20 12:30:23
  • Location: 0
  • Status: offline
Re: Linker Error when despite including .h files 2017/07/13 14:23:22 (permalink)
4 (1)
Thanks!

It turned out that I did, in fact, miss the .C files.  Been staring at this screen too long I suppose XD
#5
CinziaG
die fucking humans
  • Total Posts : 3145
  • Reward points : 0
  • Joined: 2016/12/07 14:20:36
  • Location: Wien
  • Status: offline
Re: Linker Error when despite including .h files 2017/07/13 14:38:58 (permalink)
0
It happens, yep Smile
good then!

in 2018 you signed for your annihilation. in 2019 it will come ;) I promise
my most wonderful creations here
https://www.youtube.com/c...dPFRvtwsbSTXp6Sk6azGOQ
#6
Jump to:
© 2019 APG vNext Commercial Version 4.5