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

undefined reference to `tvb_bcd_dig_to_ep_str'

0

I'm compiling the source code with some modification. Before running, my source was built several times successfully, but today when I run it again , there are some errors that I don't know what the reason is. I commented out new modification I made today but still failed. I modified a lot in the code so, it is quite difficult to comment out all of them, one by one to know where the error is. So, I post the messages got from screen to this web, if you have any idea about the reason, or any clue, please suggest me to find out the problem. Thank you very much. Here is the error:

epan/.libs/libwireshark.so: undefined reference to `tvb_bcd_dig_to_ep_str'
epan/.libs/libwireshark.so: undefined reference to `tvb_get_ephemeral_string'
epan/.libs/libwireshark.so: undefined reference to `tvb_get_ephemeral_unicode_string'
collect2: error: ld returned 1 exit status make[2]:
*** [wireshark] Error 1
 make[2]: Leaving directory `/media/sonnh/Win7_x64/wireshark_print'
 make[1]: *** [all-recursive] Error 1
 make[1]: Leaving directory `/media/sonnh/Win7_x64/wireshark_print'
 make: *** [all] Error 2

asked 25 Sep '13, 03:56

hoangsonk49's gravatar image

hoangsonk49
81282933
accept rate: 28%


2 Answers:

0

Presumably you're working from trunk, and have also updated your working copy? There is currently an effort underway to switch over the memory allocator to the newer wmem allocator, and "ephemeral" is the older type so you may have fallen foul of the changeover. Have a look at the recent developer mailing list archives for references to wmem.

answered 25 Sep '13, 04:04

grahamb's gravatar image

grahamb ♦
19.8k330206
accept rate: 22%

Yes, i'm using trunk, so is it possible to handle this problem by using an older source code to ignore the changeover?

(25 Sep '13, 04:14) hoangsonk49

Yes, switch your working copy to the trunk-1.10 branch. That will only get bugfixes, not current development.

(25 Sep '13, 04:30) grahamb ♦

I found a link on the website :link text . is it useful in this case?

(25 Sep '13, 04:36) hoangsonk49
1

There are two basic ways of working with the Wireshark source code as discussed in the Developers Guide Sect 3.3:

  1. Use a version control system such as subversion (or git) to retrieve a local copy of the sources, and to then keep that copy up to date with the main Wireshark repository. If you use this method, you should use the trunk-1.10 branch unless you like to live on the bleeding edge where all the development work goes on, in which case use trunk.
  2. Download a snapshot of the source files, e.g. a tarball, and work with that. Note that using this method it becomes much harder to track any changes that may be made to the main Wireshark source files.
(25 Sep '13, 05:05) grahamb ♦

2

You can really easily change your code to adapt to the new API:

  • replace the inclusion of epan/emem.h by the inclusion of epan/wmem/wmem.h
  • rename tvb_bcd_dig_to_ep_str(XXX) to tvb_bcd_dig_to_wmem_packet_str(XXX)
  • rename tvb_get_ephemeral_string(XXX) to tvb_get_string(wmem_packet_scope(), XXX)
  • rename tvb_get_ephemeral_unicode_string(XXX) to tvb_get_unicode_string(wmem_packet_scope(), XXX)

And you are done!

answered 25 Sep '13, 09:39

Pascal%20Quantin's gravatar image

Pascal Quantin
5.5k1060
accept rate: 30%

problem solved. I checked out the branch 1.10 and no more similar errors. Thanks!

(25 Sep '13, 18:49) hoangsonk49