Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] What is different in compilation/linking of tshark and wires

From: Pascal Quantin <pascal.quantin@xxxxxxxxx>
Date: Mon, 9 Jan 2017 15:05:08 +0100
Hi Jirka,


2017-01-09 14:54 GMT+01:00 Jirka Novak <j.novak@xxxxxxxxxxxx>:
Hello,

  I'm working on patch for wireshark in rtp area. After a time I found
that I'm not able to link tshark any more.
  I'm able to compile all files for wireshark with Qt and GTK, I'm able
to compile all files for tshark. I'm able to link wireshark and
wireshark-gtk. But once Make starts to link tshark, it ends with error,
see below.

  I'm not aware of touching makefile or such staff. I work in ui/
directory, but I just modify existing .c/.cpp/.h files.
  I'm able to compile my changes therefore I don't expect any errors in
code.
  What is strange to me is that I'm able to link wireshark, therefore my
environment is OK in general. I spend hours with checking linking
process and found no clue for observed behaving.
  I know that when I checkout master, I'm able to compile it. But when I
reapply my patch, I'm again stuck.
  I tried clean etc. with no difference too.
  Does any one have advice to do/to check?

ui folder contains files that are common to the various UI: GTK, Qt and CLI (that corresponds to tshark).
You modifications seem to make use of functions that are only available with the graphical user interfaces, and not the command line interface, thus the link failure(for example file.c is only compiled with GTK or Qt UI, not for the CLI version). It's hard to tell you more with just the link errors, but your modifications must be reorganized somehow to avoid using those functions in code parts that are in common with tshark.


Best regards,
Pascal.


                                                Sincerely yours,

                                                        Jirka Novak

Making all in .
make[2]: Entering directory 'wireshark-git'
  PERL     version.h
version.h unchanged.
  CXXLD    wireshark
  CCLD     wireshark-gtk
  CCLD     tshark
ui/libui.a(rtp_stream.o): In function `register_tap_listener_rtpstream':
wireshark-git/ui/rtp_stream.c:424: undefined reference to `simple_dialog'
ui/libui.a(rtp_stream.o): In function `rtpstream_scan':
wireshark-git/ui/rtp_stream.c:214: undefined reference to `cf_retap_packets'
ui/libui.a(rtp_stream.o): In function `rtpstream_save_as_rtpdump':
wireshark-git/ui/rtp_stream.c:252: undefined reference to `cf_retap_packets'
ui/libui.a(rtp_stream.o): In function `rtpstream_mark':
wireshark-git/ui/rtp_stream.c:385: undefined reference to `cf_retap_packets'
wireshark-git/ui/rtp_stream.c:385: undefined reference to `cf_retap_packets'
ui/libui.a(rtp_stream.o): In function `rtpstream_scan':
wireshark-git/ui/rtp_stream.c:214: undefined reference to `cf_retap_packets'
ui/libui.a(alert_box.o): In function `failure_alert_box':
wireshark-git/ui/alert_box.c:45: undefined reference to
`vsimple_error_message_box'
ui/libui.a(alert_box.o): In function `open_failure_alert_box':
wireshark-git/ui/alert_box.c:73: undefined reference to `simple_message_box'
ui/libui.a(alert_box.o): In function `read_failure_alert_box':
wireshark-git/ui/alert_box.c:89: undefined reference to `simple_message_box'
ui/libui.a(alert_box.o): In function `write_failure_alert_box':
wireshark-git/ui/alert_box.c:128: undefined reference to
`simple_message_box'
wireshark-git/ui/alert_box.c:122: undefined reference to
`simple_message_box'
ui/libui.a(alert_box.o): In function `vfailure_alert_box':
wireshark-git/ui/alert_box.c:52: undefined reference to
`vsimple_error_message_box'
collect2: error: ld returned 1 exit status
Makefile:1888: recipe for target 'tshark' failed
make[2]: *** [tshark] Error 1
make[2]: Leaving directory 'wireshark-git'
Makefile:3401: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory 'wireshark-git'
Makefile:1730: recipe for target 'all' failed
make: *** [all] Error 2
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request@wireshark.org?subject=unsubscribe