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

Ubuntu 16.04 plugin compilation issue

0

I have successfully upgraded my wireshark plugin on windows 7(from 1.6 to 2.2). It works perfectly. But now I have been trying to compile the code on Ubuntu 16.04 and it is showing a lot of errors. I have removed a lot of it but got stuck in the following issue. This appears everytime I open Wireshark.

"The plugin 'myPlugin.so' has no registration routines"

I have both -

 void proto_register_myPlugin(void);
 void proto_reg_handoff_myPlugin(void);

functions. What should I do now? Thanks

asked 09 Mar '17, 00:35

xaheen's gravatar image

xaheen
71141519
accept rate: 50%

plus, is there any official guideline for compiling custom plugin on Linux? Thanks

(09 Mar '17, 00:38) xaheen

How are you building, CMake or autotools? If you use CMake, then Windows and linux should be the same.

(09 Mar '17, 02:36) grahamb ♦

@grahamb I am using "make -f Makefile.linux" - This command

(09 Mar '17, 02:40) xaheen

One Answer:

1

Presumably that Makefile is autotools derived somehow. I suspect you'll have to regenerate the makefile using autotools and there my knowledge ends. The Developers Guide info on building on Unix is here and that suggests:

Run the autogen.sh script at the top-level wireshark directory to configure your build directory.

$ ./autogen.sh $ ./configure $ make

If you need to build with a non-standard configuration, you can run

$ ./configure –help

On the few times I’ve built on Linux I’ve used CMake, in exactly the same way as it’s done on Windows except for the actual build command where I use cmake –build rather than msbuild ….

answered 09 Mar ‘17, 03:59

grahamb's gravatar image

grahamb ♦
19.8k330206
accept rate: 22%

Thanks a lot. So after building wireshark, what cmake command do I use to compile the plugin? and do I put the plugin source code in the wireshark/plugin folder, just like on windows?

(09 Mar ‘17, 05:14) xaheen
1

CMake builds should be very similar on both platforms as that’s the point of CMake, so simply do the same as on Windows, e.e. as per section 3.1 of doc\README.plugins:

For CMake builds, either pass the custom plugin dir on the CMake generation
step command line:

CMake … -DCUSTOM_PLUGIN_SRC_DIR="plugins/foo"

or copy the top-level file CMakeListsCustom.txt.example to CMakeListsCustom.txt (also in the top-level source dir) and edit so that CUSTOM_PLUGIN_SRC_DIR is set() to the relative path of your plugin, e.g.

set(CUSTOM_PLUGIN_SRC_DIR plugins/foo)

and re-run the CMake generation step.

To build the plugin, run your normal Wireshark build step.

(09 Mar ‘17, 05:40) grahamb ♦

Thanks a lot

(09 Mar ‘17, 06:50) xaheen