This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Global variable misused in the code

0

Two days ago i got this problem when i add a global varible to the original wireshark source code, it tells me there is a compile error like this:

in load_cap_file: tshark.c:2585: undefined reference to 'fp', tshark.c:2840:undefined reference to 'fp' ... recursive error ....

Infact, i just add a global varible FILE* fp=NULL;in the file packet.c, and then extern FILE* fp; in the tshark.c . In the tshark.c file, there are some code related to the 'fp', and tshark.c will call 'dissect_packet' function in packet.c, 'fp' is also used in the function 'dissect_packet', i don't know where did i make a mistake?Is there anyone can tell me?Thank you!

asked 18 Nov '12, 18:54

rodman's gravatar image

rodman
1332
accept rate: 0%


One Answer:

0

Not all symbols are exported from libwireshark anymore. They have to be explicitly listed in libwireshark.def.

answered 18 Nov '12, 23:07

Jaap's gravatar image

Jaap ♦
11.7k16101
accept rate: 14%

I have solved this problem using the method you told me, many thanks!

(21 Nov '12, 17:34) rodman

If an answer solves your problem please accept it by clicking the checkmark icon next to the answer. This benefits other users of the site who may have similar issues.

(22 Nov '12, 00:43) grahamb ♦