Wireshark-dev: Re: [Wireshark-dev] how to include a head file
From: Peter Wu <lekensteyn@xxxxxxxxx>
Date: Fri, 28 Mar 2014 09:28:22 +0100
On Friday 28 March 2014 13:10:09 我想不无聊 wrote:
> then I add the file to /gtk/main.c file ,
> #include "peformance.h" //somebody told me not to use "../peformance.h" because there is subdir to search

Well, I was that "somebody" and refused to reply on the last private mail
because you provided *no* additional details that was requested.

> 
> peformance pef_test;
> peformance *peformance_test=&pef_test;

Please fix this typo, it is performance. PeRformance.

> in the ./wiretap/libpcap.c file, I want to use struct peformance ,
> #include "peformance.h"  //or #include "../peformance.h",i do not know which one to use
> 
> peformance_test->index=0;
> 
> it shows to me one error,the error information is :
> 
> "   wiretap/.libs/libwiretap.so: undefined reference to `peformance_test'  "
> 
> what is going on and why is that?

libwiretap is not linked with the ui, but wireshark is. If you need
your symbol in libwiretap, then define performance_test in libwiretap.
libwiretap gets linked with wireshark, so this should work fine.

Kind regards,
Peter