To enable capture traffic on multiple interfaces at once, I tried to install wireshark 1.8.3. However, I encountered the following errors: capture-pcap-util.c:274:1: error: static declaration of ‘pcap_datalink_name_to_val’ follows non-static declaration /usr/local/include/pcap/pcap.h:326:5: note: previous declaration of ‘pcap_datalink_name_to_val’ was here capture-pcap-util.c:289:1: error: static declaration of ‘pcap_datalink_val_to_name’ follows non-static declaration /usr/local/include/pcap/pcap.h:327:13: note: previous declaration of ‘pcap_datalink_val_to_name’ was here After doing some search, I found someone can fix it by reinstall libpcap-dev, or the following commands: step 1:rm & rmdir any file in '/usr/include/pcap';'/usr/local/include/pcap' step 2:Download libpcap by 'sudo apt-get install libpcap0.8-dev' step 3:./autogen.sh in wireshark dir step 4:make clean & make & make install However, neither is working on ubuntu 12.04/wireshark 1.8.3 Anyone can help? asked 08 Nov '12, 20:45 geneopenflow |
2 Answers:
Please run this command.
It will install everything that is necessary to build Wireshark on Ubuntu. See also my answer to the following question:
If you want to run Wireshark without root privileges (after you compiled and installed it), please read the answer of the following question:
Regards answered 09 Nov '12, 02:39 Kurt Knochner ♦ showing 5 of 8 show 3 more comments |
You forgot to configure your build on your platform. The offending routine is protected by answered 08 Nov '12, 23:29 Jaap ♦ I did run ./autogen.sh and ./configure before make. anything else I need to configure? thanks (09 Nov '12, 14:02) geneopenflow |
since wireshark's version in ubuntu repo is ancient, is it still valid to use apt-get build-dep wireshark? coz I wanna install a newest version from source. thanks a lot
'apt-get build-dep wireshark' just installs all libs and tools (the dependencies) that are necessary to build Wireshark. You still need the current sources (either 1.8.3 or the svn tree) to build your version of Wireshark.
thanks, Kurt. However, after I run apt-get build-dep wireshark and make clean, I reconfigure and make the source. the same problems are still there. Any other possibility?
strange, it works out of the box on my Ubuntu 12.04.
However, if you still get an error messages about the file /usr/local/include/pcap/pcap.h, there must be something different/wrong on your system, as I don't have that file and it's not part of libpcap0.8-dev !?!
If there is really a file pcap.h in /usr/local/include, please post the output of the following commands:
If the file does not exist, can you please delete your wireshark build directory, download the 1.8.3 sources again and to build it from scratch?
Thanks, Kurt. After several operations, I dont have a dir named /usr/local/include/pcap and the error becomes "/usr/include/pcap/pcap.h:327:13: note: previous declaration of ‘pcap_datalink_val_to_name’ was here " So seems I need to delete the wireshark build directory as you suggested. I think it makes sense coz before I build wireshark 1.8.3 I installed wireshark 1.6.2 and then I remove it from the package manager. I highly doute that I do not completely clean the old version. So could you tell me the complete command to delete wireshark build directory? thanks
well, I suggest to delete the whole source tree and start from scratch. If you extracted the source to /soft/wireshark run the following command to delete everything.
Then extract the source again to /soft/wireshark and run
thanks kurt. I did so, the same problems: capture-pcap-util.c:274:1: error: static declaration of ‘pcap_datalink_name_to_val’ follows non-static declaration /usr/include/pcap/pcap.h:326:5: note: previous declaration of ‘pcap_datalink_name_to_val’ was here capture-pcap-util.c:289:1: error: static declaration of ‘pcap_datalink_val_to_name’ follows non-static declaration /usr/include/pcap/pcap.h:327:13: note: previous declaration of ‘pcap_datalink_val_to_name’ was here
Hm.. strange thing, and I have no good idea.
Let's try the brute force method. Please post the output of the following commands: