# Error building Wireshark - Windows

 0 After some issues with my PATH variable I finally got to build Wireshark. All went well until what looks like the final linker command, then I got the following error:  cl -c -nologo -Zm200 -Zc:wchar_t -FS /DWINPCAP_VERSION=4_1_3 /Zi /W3 /MD /O2 /DWIN32_LEAN_AND_MEAN /DMSC_VER_REQUIRED=1600 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE -DPSAPI_VERSION=1 /MP /w34295 /w34189 /DNOMINMAX -GR -W3 -w34100 -w34189 -EHsc -DUNICODE -DWIN32 -DWIN64 -DINET6 -DREENTRANT -DHAVE_PCAP_REMOTE -DHAVE_PCAP_SETSAMPLING -DQT_NO_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_WINEXTRAS_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_OPENGL_ES_2 -DQT_OPENGL_ES_2_ANGLE -DNDEBUG -I"...." -I"....\wiretap" -I"C:\Wireshark-win64-libs\gtk2\include\glib-2.0" -I"C:\Wireshark-win64-libs\gtk2\lib\glib-2.0\include" -I"C:\Wireshark-win64-libs\gtk3\include\glib-2.0" -I"C:\Wireshark-win64-libs\gtk3\lib\glib-2.0\include" -I"C:\Wireshark-win64-libs\WpdPack\Include" -I"C:\Wireshark-win64-libs\AirPcap_Devpack_4_1_0_1622\Airpcap_Devpack\include" -I"C:\Wireshark-win64-libs\gnutls-3.2.15-2.9-win64ws\include" -I"C:\Wireshark-win64-libs\GeoIP-1.5.1-2-win64ws\include" -I"C:\Wireshark-win64-libs\zlib125\include" -I"C:\Qt\5.3\msvc2013_64\include" -I"C:\Qt\5.3\msvc2013_64\include\QtPrintSupport" -I"C:\Qt\5.3\msvc2013_64\include\QtWinExtras" -I"C:\Qt\5.3\msvc2013_64\include\QtWidgets" -I"C:\Qt\5.3\msvc2013_64\include\QtGui" -I"C:\Qt\5.3\msvc2013_64\include\QtANGLE" -I"C:\Qt\5.3\msvc2013_64\include\QtCore" -I"." -I"." -I"C:\Qt\5.3\msvc2013_64\mkspecs\win32-msvc2013" -Fo @C:\Users\Sid\AppData\Local\Temp\nm8A26.tmp cl : Command line error D8021 : invalid numeric argument '/FS' NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0 \VC\Bin\amd64\cl.EXE"' : return code '0x2' Stop. NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0 \VC\Bin\amd64\nmake.EXE"' : return code '0x2'  Any help would be much appreciated, Sid. asked 25 Nov '14, 08:08 sid Price 21●2●2●6 accept rate: 0%

 0 Things have got messed up in your build environment. It may well be time to blow the Wireshark source directory away and grab the sources again and build from the beginning. You can keep the libs dir. Changing compilers and x86\x64 choice in the same directory isn't recommended, pick one and stick to it. If you want to build an x64 version with QT, you need to be using VS2012 at a minimum, but I think you may then have to use Qt < 5.3 which has it's own issues. If you have VS2013 (and with the free Community Edition there is no cost) then I would recommend you use that. Note that the Dev Guide hasn't yet been fully updated for VS2013, I have some drafts for the docs but they're not ready yet. Changing compiler and or x86\x64 choice can leave an incorrect ui\qt\config.pri file. Deleting that may help. If using VS2013, this is the simplest method I can come up with, it doesn't require you to make any changes to configuration files etc. No changes to your PATH environment variable should be needed (as long as it doesn't have ...\Git\bin): Open a Visual Studio command prompt (from the start menu, Visual Studio 2013 | Visual Studio Tools) either x86 Native or x64 Native as required. Set some environment vars (adjusting paths or values to suit your build), I keep these in a batch file, note that WIRESHARK_BASE_DIR is a directory that contains the sources in a subdirectory "wireshark": set CYGWIN=nodosfilewarning set WIRESHARK_BASE_DIR=path\to\top\level\directory set WIRESHARK_TARGET_PLATFORM=win32 set QT5_BASE_DIR=C:\Qt\Qt5.3.0\5.3\msvc2013 cd path\to\top\level\directory\wireshark nmake -f makfile.nmake verify_tools nmake -f makfile.nmake setup nmake -f makfile.nmake answered 26 Nov '14, 06:16 grahamb ♦ 19.8k●3●30●206 accept rate: 22% grahamb Thanks you, I will give this a try a little later and let you know how it goes. The reason I would like to build both x86 and x64 is that I have a partner who is running Wireshark x86 and my computer is x64, we have a product with a custom protocol and having a dissector for it woule speed some of our system debugging. Thanks again, Sid. (26 Nov '14, 07:12) sid Price You can run the x86 build on x64 Windows, I do that all the time. Unless you specifically need the huge memory available in x64 (in which case working with such captures would be miserable) just stick with the x86 version. (26 Nov '14, 07:30) grahamb ♦ Hello again, I have deleted the Wireshark source tree and cloned it again from https://code.wireshark.org/review/wireshark. I started to create the a batch file to set my environment variables for an x86 build and ran into a problem, my QT5 tree does not have a sub folder that looks like it is good for VS2013 and x86. I have the following only: android_armv7 msvc2010_opengl msvc2013_64 winphone_arm winphone_x86 winrt_x64 What do I use for VS2013 x86? I did try an x64 build with the following settings in a batch file:  set CYGWIN=nodosfilewarning set WIRESHARK_BASE_DIR=C:\DataRoot\Projects\Wireshark set WIRESHARK_TARGET_PLATFORM=win64 set QT5_BASE_DIR=C:\Qt\5.3\msvc2013_64\bin  I ran it in the VS 2013 x64 native compiler command window and then ran "nmake -f makefile.nmake verify_tools", I got the following error:  C:\DataRoot\Projects\Wireshark>nmake -f makefile.nmake verify_tools  Microsoft (R) Program Maintenance Utility Version 12.00.21005.1 Copyright (C) Microsoft Corporation. All rights reserved. makefile.nmake(8) : fatal error U1052: file 'win32.mak' not found Stop.  Any input much appreciated, Sid. (26 Nov '14, 09:24) sid Price For x86 qt you'll need to download the appropriate item e.g. Qt 5.3.2 for Windows 32-bit (VS 2013, OpenGL, 559.2 MB). Note that the title means that the QT package is 32 bit, not that it's only for 32 bit Windows. For Win32.mak see this question: https://ask.wireshark.org/questions/4725/file-win32mak-not-found-stop (26 Nov '14, 09:41) grahamb ♦ I also see an issue with your setup, you have set WIRESHARK_BASE_DIR=C:\DataRoot\Projects\Wireshark and then are running C:\DataRoot\Projects\Wireshark>nmake -f makefile.nmake verify_tools. WIRESHARK_BASE_DIR should be set one level higher than your source directory, e.g C:\DataRoot\Projects in your case. The 3rd party libs will be installed in WIRESHARK_BASE_DIR\wireshark-win32-libs (or WIRESHARK_BASE_DIR\wireshark-win64-libs) (26 Nov '14, 09:46) grahamb ♦ Thank you, I have the x64 build working. I needed to make a couple of other changes to my batch file in addition to the one you suggested. Here is my current file, run after opening the VS 2013 x64 native compiler command window:  set CYGWIN=nodosfilewarning set CYGWIN_BASE=C:\cygwin64\bin set WIRESHARK_BASE_DIR=C:\DataRoot\Projects set WIRESHARK_TARGET_PLATFORM=win64 set QT5_BASE_DIR=C:\Qt\5.3\msvc2013_64 set INCLUDE=%INCLUDE%;c:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include  The last line added after reading the link you posted. Since I would like to build the x86 as well what is the recommended way of doing this on a single development machine? Many thanks for your help and patience, Sid (26 Nov '14, 11:08) sid Price At the moment for nmake I recommend two repositories. I think you can switch one repo between x86 and x64 builds only if you nmake -f makefile.nmake clean and then delete ui\qt\config.pri. To be honest though do you actually need an x64 version? Hopefully we'll soon finish off the CMake build system for Windows that builds out-of-source so that one source repo can support many builds. (26 Nov '14, 11:30) grahamb ♦ Thanks to your efforts and help I now have two repositories on my dev machine and I am able to build both x86 and x64 Wiresharks. So very much appreciated. Now my next challenge is learning about writing and debugging a protocol dissector. If you have any suggestions for a getting started tutorial for dissector writing I would love to see them. Sid. (26 Nov '14, 13:33) sid Price As it happens you're in luck. See my SharkFest'13 presentation on writing a dissector using 3 options, WSGD, Lua and C. If using C, you absolutely must read doc\README.Dissector. (26 Nov '14, 23:39) grahamb ♦ Great, I will start by playing with your sample. (27 Nov '14, 10:21) sid Price showing 5 of 10 show 5 more comments
 toggle preview community wiki:

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported

Question tags:

×254
×193
×110
×10
×7

question asked: 25 Nov '14, 08:08

question was seen: 3,232 times

last updated: 27 Nov '14, 10:21

### Related questions

p​o​w​e​r​e​d by O​S​Q​A