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

build plugin dissector windows

0

Hello, I try to build a custom plugin dissector on windows. I work on sources from tag 2.0.1. Build with VS2013 express.

The build environnement is working (https://www.wireshark.org/docs/wsdg_html_chunked/ChSetupWin32.html) even if I'm not able to make the installer and there are some errors on doc generation but that's not the point.

When I try to build a plugin (for example gryphon "nmake -f Makefile.nmake all" ) I get following error : NMAKE : fatal error U1073: incapable d'obtenir '....\epan\libwireshark.lib' .

Can anyone help me to build the missing file : libwireshark.lib or explein what is wrong in how I build the plugin ?

asked 24 Feb '16, 02:15

atsju2's gravatar image

atsju2
11347
accept rate: 0%


One Answer:

0

You likely haven't followed the Developers Guide instructions exactly as written as CMake is now the primary build system for 2.x and CMake will generate a Visual Studio solution that you build using Visual Studio or msbuild, rather than nmake.

answered 24 Feb '16, 02:57

grahamb's gravatar image

grahamb ♦
19.8k330206
accept rate: 22%

Thank you for your answer about Cmake and VS. Even if a bit short it helps me search in the right direction.

Be sure I (re-re-re-)read the Developers Guide and README.plugins. I even had a look to README.dissector but I haven't seen precise information on how to build the plugins.

  • I cleaned my git checkout.
  • I folowed README.plugins until step 3.1 included (I have a plugin\foo directory and I do not need a permanent addition, I just want to build my plugin to get the dll to add in existing wireshark installations.)
  • Cmake at top level generates the visual studio solution .
  • I build wireshark with msbuild. (gryphon seems to build...)

So far so good, now how to build the foo plugin ?

Meanwhile I will try to do the permanent addition procedure but I still want to undestand how to do the custom extension! => permanent addition seems to work. Custom extension should be better explained or removed from documentation if not compatible with Cmake.

(24 Feb '16, 05:41) atsju2

@atsju2

Your "answer" has been converted to a comment as that's how this site works. Please read the FAQ for more information.

A quick look at README.plugins shows there's some improvement to be made.

To add a temporary custom plugin, re-run the CMake generation step adding the following definition to the CMake command, modified as appropriate for your plugin:

-D CUSTOM_PLUGIN_SRC_DIR="plugins/foo"

Then build as before (VS or msbuild).

To make a permanent addition, modify the top-level CMakeLists.txt to add the plugin directory to the PLUGIN_DIRS list.

(24 Feb '16, 07:44) grahamb ♦

In the plugin dir create a file CMakeListsCustom.txt

In the file add:

set(CUSTOM_PLUGIN_SRC_DIR foo/bar )

(24 Feb '16, 08:43) Anders ♦
1

I think @Anders meant: copy the source top-level CMakeListsCustom.txt.example to CMakeListsCustom.txt (also in the source top-level directory), and edit to set CUSTOM_PLUGIN_SRC_DIR as required. Note the relative path from the top-level source dir is required.

Making the change this way will affect all subsequent CMake generation steps. The way I noted will only affect the CMake generation step it's used on (and thereafter as it's cached in CMakeCache.txt).

(24 Feb '16, 09:10) grahamb ♦

Thank you, the last solution works and is easyer then the permanent addition. README.plugin should be updated to be more complete

(25 Feb '16, 01:11) atsju2
1

This was done in commit 4fec250ed.

(25 Feb '16, 04:27) grahamb ♦
showing 5 of 6 show 1 more comments