Ask Your Question

Getting error MSB4018 when trying to build wireshark sources

asked 2017-11-14 11:44:02 +0000

Bella gravatar image

updated 2017-11-14 13:38:30 +0000

grahamb gravatar image

Hi, I followed Quick setup guide found here: and installed and configured everything as described. But when I tried to compile the latest wireshark sources I received many errors like that:

"C:\wiresharkDev\wsbuild32\Wireshark.sln" (default target) (1) ->
  "C:\wiresharkDev\wsbuild32\ui\ui.vcxproj.metaproj" (default target) (57) ->
    "C:\wiresharkDev\wsbuild32\ui\ui.vcxproj" (default target) (93) ->
     C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB4018: The "CustomBuild" task failed unexpectedly.\r [C:\wiresharkDev\wsbuild32\ui\ui.vcxproj]

Could anybody help me to solve it? Many thanks, Bella

edit retag flag offensive close merge delete


Please show the full output of the CMake generation step, redirect to a file as shown below, copy the file to a public file sharing site, e.g. Google Drive, DropBox etc. and then post a link to the file in a comment.

CMake "Your arguments" 2>&1 > cmake.txt
grahamb gravatar imagegrahamb ( 2017-11-14 13:40:53 +0000 )edit

Thank you for helping me with this issue! According to your request I used this command

cmake -DENABLE_CHM_GUIDES=on -G "Visual Studio 14" ..\wireshark 2>&1 > cmake.txt.

cmake.txt could be found here: link text

Bella gravatar imageBella ( 2017-11-14 13:53:44 +0000 )edit

1 Answer

Sort by » oldest newest most voted

answered 2017-11-14 14:54:00 +0000

grahamb gravatar image

From your CMake output:

-- The following OPTIONAL packages have not been found:

* Gettext
* M
* Qt5Core
* Qt5LinguistTools
* Qt5Multimedia
* Qt5PrintSupport
* Qt5Svg
* Qt5Widgets
* Qt5WinExtras
* PkgConfig

The others are expected and OK on Windows, but the Qt ones are not. Your build environment for Qt is not setup correctly as per the Developers Guide Sect 2.2.3, either you haven't installed Qt or you haven't set the QT5_BASE_DIR environment variable.

edit flag offensive delete link more


I use the following settings:

set CYGWIN=nodosfilewarning   
set WIRESHARK_BASE_DIR=C:\wiresharkDev   
set QT5_BASE_DIR=C:\Qt\Qt5.9.2\vcredist\vcredist_msvc2015_x86.exe   

What's wrong here?

Bella gravatar imageBella ( 2017-11-14 16:37:21 +0000 )edit

You have the wrong path set in QT5_BASE_DIR. It should be C:\Qt\Qt5.9.2\msvc2015.

grahamb gravatar imagegrahamb ( 2017-11-14 16:56:47 +0000 )edit

But there is no msvc2015 directory under C:\Qt\Qt5.9.2 What does it mean?

Bella gravatar imageBella ( 2017-11-14 17:02:45 +0000 )edit

Somewhere under C:\Qt you should be able to find windeployqt.exe, that's usually in a "bin" directory. You need to set QT5_BASE_DIR to the directory above the "bin" directory.

For example I have (using Qt 5.9.1):

    \msvc_2015    <--- set QT5_BASE_DIR to here.
grahamb gravatar imagegrahamb ( 2017-11-14 17:08:47 +0000 )edit

Thanks a lot for your great help! I understood the issue finally – it was related to wrong QT installation. When installing you need to select QT 5.9.2 -> msvc 2015 32 bit ( it was not selected by default). That’s why I didn’t have a folder containing windeployqt.exe. Now QT5_BAS_DIR set to C:\Qt\Qt5.9.2\5.9.2\msvc2015 - you can find cmake.txt file here

But when I compile I end up with the same errors that I started from:

"C:\wiresharkDev\wsbuild32\Wireshark.sln" (default target) (1) ->
       "C:\wiresharkDev\wsbuild32\codecs\wscodecs.vcxproj.metaproj" (default target) (75) ->
       "C:\wiresharkDev\wsbuild32\codecs\wscodecs.vcxproj" (default target) (110) ->
         C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB4018: The "CustomBuild" task failed unexpectedly.\r [C:\wiresharkDev\wsbuild32\codecs\wscodecs.vcxproj]
       C:\Program Files (x86 ...
Bella gravatar imageBella ( 2017-11-14 21:30:39 +0000 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2017-11-14 11:44:02 +0000

Seen: 37 times

Last updated: Nov 14