Problem compiling under Windows
asked Aug 05 '25
updated Aug 07 '25
I'm trying to build Wireshark under Windows in order to develop a dissector for a protocol.
During the CMake stage, I get the following messages:
CMake Error in epan/CMakeLists.txt:
Target "epan" INTERFACE_INCLUDE_DIRECTORIES property contains path:
"C:/Users/andy/source/repos/wireshark/wireshark-x64-libs/vcpkg-export-2025.04.09-x64-windows-ws/installed/x64-windows/include/glib-2.0"
which is prefixed in the source directory.
CMake Error in epan/CMakeLists.txt:
Target "epan" INTERFACE_INCLUDE_DIRECTORIES property contains path:
"C:/Users/andy/source/repos/wireshark/wireshark-x64-libs/vcpkg-export-2025.04.09-x64-windows-ws/installed/x64-windows/lib/glib-2.0/include"
which is prefixed in the source directory.
CMake Error in wsutil/CMakeLists.txt:
Target "wsutil" INTERFACE_INCLUDE_DIRECTORIES property contains path:
"C:/Users/andy/source/repos/wireshark/wireshark-x64-libs/vcpkg-export-2025.04.09-x64-windows-ws/installed/x64-windows/include/glib-2.0"
which is prefixed in the source directory.
CMake Error in wsutil/CMakeLists.txt:
Target "wsutil" INTERFACE_INCLUDE_DIRECTORIES property contains path:
"C:/Users/andy/source/repos/wireshark/wireshark-x64-libs/vcpkg-export-2025.04.09-x64-windows-ws/installed/x64-windows/lib/glib-2.0/include"
which is prefixed in the source directory.
CMake Error in wsutil/CMakeLists.txt:
Target "wsutil" INTERFACE_INCLUDE_DIRECTORIES property contains path:
"C:/Users/andy/source/repos/wireshark/wireshark-x64-libs/libgcrypt-bundle-1.11.1-1-x64-mingw-dynamic-ws/include"
which is prefixed in the source directory.
CMake Error in wsutil/CMakeLists.txt:
Target "wsutil" INTERFACE_INCLUDE_DIRECTORIES property contains path:
"C:/Users/andy/source/repos/wireshark/wireshark-x64-libs/gnutls-3.8.10-1-x64-mingw-dynamic-ws/include"
which is prefixed in the source directory.
CMake Error in wsutil/CMakeLists.txt:
Target "wsutil" INTERFACE_INCLUDE_DIRECTORIES property contains path:
"C:/Users/andy/source/repos/wireshark/wireshark-x64-libs/xxhash-0.8.3-1-x64-windows-ws/installed/x64-windows/include"
which is prefixed in the source directory.
-- Generating done (3.7s)
CMake Generate step failed. Build files cannot be regenerated correctly.
I'm running the CMake command in c:\users\andy\source\repos\wireshark-build, and the wireshark source is in C:\Users\andy\source\repos\wireshark
Anyone tell me what I'm doing wrong?
Thanks
Andy

Has this ever worked or first time? What is the cmake command string you're running?
WSDG 2.2.1.12. Generate the build files
This is my first attempt. This is the command line:
C:\Users\andy\source\repos\wireshark
Andy
From the WSDG, sect. 2.2.1.11, sub item 2.
You seem to have the build dir inside the git repo dir.
That was my first thought, but the build dir is:
cmake -G "Visual Studio 16 2019" -A x64 ..\wireshark
and the source dir is
C:\Users\andy\source\repos\wireshark
Ah, my mistake, you seem to have the third-party libs under the source directory, which I've never done but might be the issue. Normally there are three parallel dirs;
The latter path is set by the env var
WIRESHARK_LIB_DIR.17477: cmake generation fails
Ok, I'll try that. The build instructions suggest that way should work though:
What is
WIRESHARK_BASE_DIRand/ orWIRESHARK_LIB_DIRset to on your system?