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 |
One Answer:
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 ♦ showing 5 of 6 show 1 more comments |
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.
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.
@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:
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.
In the plugin dir create a file CMakeListsCustom.txt
In the file add:
set(CUSTOM_PLUGIN_SRC_DIR foo/bar )
I think @Anders meant: copy the source top-level
CMakeListsCustom.txt.example
toCMakeListsCustom.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).
Thank you, the last solution works and is easyer then the permanent addition. README.plugin should be updated to be more complete
This was done in commit 4fec250ed.