First time here? Check out the FAQ!
THIS IS A TEST INSTANCE. Feel free to ask and answer questions, but take care to avoid triggering too many notifications.
0

Out of Tree Dissector Build Problems

  • retag add tags

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 ... (more)

SteveD's avatar
3
SteveD
asked 2024-08-01 21:01:21 +0000
edit flag offensive 0 remove flag close merge delete

Comments

You might read through 17237: wireshark/doc/plugins.example build problem

-- Building for: Visual Studio 17 2022


I'm not sure out of tree is possible on Windows.

Chuckc's avatar Chuckc (2024-08-02 00:43:59 +0000) edit
add a comment see more comments

1 Answer

0

From the plugins.example

Note that the out-of-tree method builds the plugin using CMake's Config-file mechanism[1] for configuration. In other words the plugin build system uses the Wireshark headers that were installed on the system using "make install" or equivalent (as configured from WiresharkConfig.cmake). This is not the same as an in-tree build.

The Windows builds do not create a "headers" (or -dev) package so this is unlikely to work on Windows.

I would create a git branch in your repo (which should be from the canonical GitLab not GitHub repo) to contain your plug-in in-tree and sync the branch to master as required.

grahamb's avatar
23.8k
grahamb
answered 2024-08-02 08:44:02 +0000
edit flag offensive 0 remove flag delete link

Comments

Comment on 17237:

To recap at the moment there is no SDK for macOS (with appbundle) or Windows (with installer).


Should doc/plugins.example/README be updated to exclude Mac and Windows from out of tree builds?

Chuckc's avatar Chuckc (2024-08-02 11:43:06 +0000) edit

Probably. Possibly created by balint who is a Linux person.

grahamb's avatar grahamb (2024-08-02 11:48:47 +0000) edit
add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer