Out of Tree Dissector Build Problems on Windows
I have successfully downloaded the source and compiled Wireshark from sources. The built executable runs. I followed the instructions here: https://www.wireshark.org/docs/wsdg_h...
I am now trying to compile the "out of tree" dissector example here: https://github.com/wireshark/wireshar...
As recommended by the instructions, my wireshark source code is in c:\development\wireshark
After compiling Wireshark, I now have a C:\Development\wsbuild64
directory too.
I have copied the plugin.example code out of the wireshark tree, so I also have a C:\Development\plugins.example
directory.
I have created a build
directory beneath the plugin.example directory, so I also have a C:\Development\plugins.example\build
. I believe this is what https://github.com/wireshark/wireshar... is suggesting, though it is not entirely clear to me.
I then execute
C:\Development\plugins.example\build>cmake -DCMAKE_PREFIX_PATH="C:\Development\wsbuild64" ..
The first hurdle I had to get past (alluded to in C:\Development\wsbuild64\WiresharkConfig.cmake
was to create an empty folder so that cmake doesn't error out: I created C:\Development\include\wireshark
- I hope this is right.
From WiresharkConfig.cmake...
set_and_check(Wireshark_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/include/wireshark")
#
# set_and_check() cannot be used with directories that may or may not exist.
# If no plugins or extcaps are built the respective directories will not exist in the target
# system and set_and_check() and therefore find_package() will fail with a FATAL_ERROR,
# which is not helpful because the variable is correct, it's just that the empty directories
# were not created (also correctly, empty directories are just noise).
#
However, after getting this far, I appear to have one or possibly two further errors that I am unable to fix...
C:\Development\plugins.example\build>cmake -DCMAKE_PREFIX_PATH="C:\Development\wsbuild64" ..
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.
-- The C compiler identification is MSVC 19.40.33813.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Error at C:/Development/wsbuild64/WiresharkConfig.cmake:50 (include):
include could not find requested file:
C:/Development/wsbuild64/WiresharkTargets.cmake
Call Stack (most recent call first):
CMakeLists.txt:15 (find_package)
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of ssize_t
-- Check size of ssize_t - failed
-- Configuring incomplete, errors occurred!
C:\Development\plugins.example\build>
The first...
include could not find requested file:
C:/Development/wsbuild64/WiresharkTargets.cmake
... I am not sure whether this is a fatal error or really a warning, as the script continues and another error is given...
-- Check size of ssize_t
-- Check size of ssize_t - failed
-- Configuring incomplete, errors occurred!
This is where the script stops.
I will be just ...
You might read through 17237: wireshark/doc/plugins.example build problem
I'm not sure out of tree is possible on Windows.
I did manage to get over the
WiresharkConfig.cmake
issue mentioned in this post, by usingcmake -DCMAKE_PREFIX_PATH="C:\Development\wsbuild64"
, so I got further than the guy in this post I think.Also, I think (though it's very hard to follow) he is trying to build without installing Wireshark. I have installed Wireshark. But maybe that doesn't give me what I need. It's hard for me to know. I am slowly joining the dots, but more dots keep appearing!
The goal is one of these - Package: wireshark-dev (4.2.6-1) - for Windows.
It's a mixture of static and build process generated files.