I want to use TShark source files to dissect a message (e.g rrc sib 3 message) in C++. I have done the following steps:
- Download
wireshark-2.6.6.tar.xz
and go to the extracted folder. sudo ./configure --prefix=/home/***/build/
sudo make -j 8
sudo make install
(After that I have a build folder which is contains bin, include, lib, share folders.)Open C++ ide (Qt) and add the following libs:
LIBS += -L/home/***/build/lib/ -lwireshark \ -L/home/***/build/lib/ -lwiretap \ -L/home/***/build/lib/ -lwsutil \ -L/home/***/build/lib/ -lwscodecs
Of course I include the path like this:
INCLUDEPATH += /home/***/build/include/wireshark DEPENDPATH += /home/***/build/include/wireshark
And also the wireshark source folder which I downloaded in step 1:
INCLUDEPATH += /home/***/wireshark-2.6.6 DEPENDPATH += /home/***/wireshark-2.6.6
Open TShark.c file (/home/***/wireshark-2.6.6/tshark.c) in Qt.
After these steps, it seems that every thing should be OK, but I have undefined reference to about 70 functions that I think I should add some other libs in step 5.
A part of my code (tshark.c
) is as follows:
...
...
...
static int
real_main(int argc, char *argv[])
{
...
initialize_funnel_ops();
return exit_status;
}
int
main(int argc, char *argv[])
{
return real_main(argc, argv);
}
...
...
...
The initialize_funnel_ops()
function which is in /build/include/wireshark/epan/funnel.h
gives this error:
error: undefined reference to `initialize_funnel_ops'
This error apears for some other funtions too.
So how can I solve it? Should I add a new library? Or did I make a mistake in adding the libraries and the path?