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

Getting error MSB4018 when trying to build wireshark sources

Hi, I followed Quick setup guide found here: https://www.wireshark.org/docs/wsdghtmlchunked/ChSetupWin32.html 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

Bella's avatar
3
Bella
asked 2017-11-14 11:44:02 +0000
grahamb's avatar
23.8k
grahamb
updated 2017-11-14 13:38:30 +0000
edit flag offensive 0 remove flag close merge delete

Comments

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's avatar grahamb (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's avatar Bella (2017-11-14 13:53:44 +0000) edit
add a comment see more comments

1 Answer

0

From your CMake output:

-- The following OPTIONAL packages have not been found:

* CAP
* Gettext
* M
* Qt5Core
* Qt5LinguistTools
* Qt5Multimedia
* Qt5PrintSupport
* Qt5Svg
* Qt5Widgets
* Qt5WinExtras
* SETCAP
* PkgConfig
* LYNX

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.

grahamb's avatar
23.8k
grahamb
answered 2017-11-14 14:54:00 +0000
edit flag offensive 0 remove flag delete link

Comments

I use the following settings:

set CYGWIN=nodosfilewarning   
set WIRESHARK_BASE_DIR=C:\wiresharkDev   
set WIRESHARK_TARGET_PLATFORM=win32   
set QT5_BASE_DIR=C:\Qt\Qt5.9.2\vcredist\vcredist_msvc2015_x86.exe   
set WIRESHARK_VERSION_EXTRA=-bella

What's wrong here?

Bella's avatar Bella (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's avatar grahamb (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's avatar Bella (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):

C:\Qt
  \5.9.1
    \msvc_2015    <--- set QT5_BASE_DIR to here.
      \bin
        \windeployqt.exe
grahamb's avatar grahamb (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 ...
(more)
Bella's avatar Bella (2017-11-14 21:30:39 +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