WireShark Cmake compilation error FATAL_ERROR "Windows setup (win-setup.ps1) failed

created at 08-16-2021 views: 7

According to the official document instructions, after gitting WireShark to the C:\Development folder, enable the vs2019 command line to compile it, and the following error message is reported:

CMake Error at CMakeLists.txt:146 <message>:
    message(FATAL_ERROR "Windows setup (win-setup.ps1) failed.")

I had been busy with this error for more than a day, but I was still puzzled and suddenly realized:

Let's take a look at the official document content

Set the following environment variables, using paths and values suitable for your installation:

> rem Let CMake determine the library download directory name under
> rem WIRESHARK_BASE_DIR or set it explicitly by using WIRESHARK_LIB_DIR.
> rem Set *one* of these.
> set WIRESHARK_BASE_DIR=C:\Development
> rem set WIRESHARK_LIB_DIR=c:\wireshark-win64-libs
> rem Set the Qt installation directory
> set QT5_BASE_DIR=C:\Qt\5.15.2\msvc2019_64
> rem Append a custom string to the package version. Optional.
> set WIRESHARK_VERSION_EXTRA=-YourExtraVersionInfow

reason and solution

The problem appears in the setting of WIRESHARK_BASE_DIR. After the official default git is down, all the source code content is in the Development folder

But in fact, after git is down, it is under C:\Development\wireshark

Replace the corresponding command with set WIRESHARK_BASE_DIR=C:\Development\wireshark

CMake again, it succeeded

created at:08-16-2021
edited at: 08-16-2021: