This is our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

I copied a 32-bit build code(after running distclean) and changed "WIRESHARK_TARGET_PLATFORM=win64" in the config.nmake file.

Then I setup the build environment using the command: "CALL "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64"

Then, after running the commands:

nmake -f Makefile.nmake distclean

nmake -f Makefile.nmake setup

nmake -f Makefile.nmake distclean

in that order, when I build the code I get the following error:

    Microsoft (R) Program Maintenance Utility Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.

Verifying library package files ...

Microsoft (R) Program Maintenance Utility Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.

Wireshark is ready to build.
        sed -e s/@[email protected]/1.9.0-sid1/  -e "s/@HA[email protected]/#define HAVE_C
_ARES 1/"  -e "s/@HA[email protected]//"  -e "s/@HA[email protected]//"  -e "s/@HA[email protected]//"
  -e "s/@HA[email protected]/#define HAVE_LIBZ 1/"  -e "s/@HA[email protected]/#define HAVE_LIB
PCAP 1/"  -e "s/@HA[email protected]/#define HAVE_PCAP_FINDALLDEVS 1/"  -e "s
/@HA[email protected]/#define HAVE_PCAP_DATALINK_NAME_TO_VAL 1/"  -e
 "s/@HA[email protected]/#define HAVE_PCAP_DATALINK_VAL_TO_NAME 1/"
 -e "s/@HA[email protected]/#define HAVE_PCAP_DATALINK_VAL_TO
_DESCRIPTION 1/"  -e "s/@HA[email protected]//"  -e "s/@HA[email protected]/#define HA
VE_REMOTE 1/"  -e "s/@HA[email protected]/#define HAVE_PCAP_REMOTE 1/"  -e "s/@HAV
[email protected]/#define HAVE_PCAP_OPEN 1/"  -e "s/@HAVE_PCA[email protected]/#define HAV
E_PCAP_OPEN_DEAD 1/"  -e "s/@HA[email protected]/#define HAVE_PCAP_LIST_DA
TALINKS 1/"  -e "s/@HA[email protected]/#define HAVE_PCAP_FREE_DATALINKS 1
/"  -e "s/@HA[email protected]/#define HAVE_PCAP_SET_DATALINK 1/"  -e "s/@HA
[email protected]/#define HAVE_PCAP_SETSAMPLING 1/"  -e "s/@HA[email protected]/#
define HAVE_BPF_IMAGE 1/"  -e "s/@HA[email protected]/#define HAVE_LIBWIRESHAR
KDLL 1/"  -e "s/@HA[email protected]/#define HAVE_LIBGNUTLS 1/"  -e "s/@HAVE_LIBGCRY
[email protected]/#define HAVE_LIBGCRYPT 1/"  -e "s/@HA[email protected]/#define HAVE_LUA 1/"  -e "s/@HA
[email protected]/#define HAVE_LUA 1/"  -e "s/@HA[email protected]//"  -e "s/@HA[email protected]/#defi
ne HAVE_AIRPCAP 1/"  -e "s/@HA[email protected]//"  -e "s/@HA[email protected]/#define
 HAVE_LIBPORTAUDIO 1/"  -e "s/@[email protected]//"  -e "s/@HA[email protected]/#define HAV
E_LIBSMI 1/"  -e "s/@HA[email protected]/#define HAVE_GEOIP 1/"  -e "s/@HA[email protected]/#
define HAVE_GEOIP_V6 1/"  -e "s/@[email protected]/#define INET6 1/"  -e "s/@HAVE_NTDDNDIS_
[email protected]/#define HAVE_NTDDNDIS_H 1/"  -e "s/@[email protected]/#define PCAP_NG_DEFAULT
1/"  -e "s/@[email protected]//"  < config.h.win32 > config.h
        cd tools
        "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\amd64\nmake.
exe" /                   -f Makefile.nmake

Microsoft (R) Program Maintenance Utility Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.

        cd lemon
        ..\native-nmake "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\
Bin\amd64\nmake.exe" /                   -f Makefile.nmake

Microsoft (R) Program Maintenance Utility Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.

        cl -WX -D_U_="" /Zi /W3 /MD /DWIN32_LEAN_AND_MEAN /DMSC_VER_REQUIRED=160
0  /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /MP /GS lemon.c
Microsoft (R) C/C++ Optimizing Compiler Version 16.00.40219.01 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

lemon.c
Microsoft (R) Incremental Linker Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:lemon.exe
/debug
lemon.obj
        cd ..
        cd ..
        cd image
        "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\amd64\nmake.
exe" /                   -f Makefile.nmake

Microsoft (R) Program Maintenance Utility Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.

        sed -e s/@[email protected]/1/  -e s/@[email protected]/9/  -e s/@VERSION_MICR
[email protected]/0/  -e s/@[email protected]/amd64/  < wireshark.exe.manifest.in > wires
hark.exe.manifest
        sed -e s/@[email protected]/1.9.0-sid1/  -e s/@[email protected]/1,9,0,0/  < wire
shark.rc.in > wireshark.rc
        sed -e s/@[email protected]/1.9.0-sid1/  -e s/@[email protected]/1,9,0,0/  < libw
ireshark.rc.in > libwireshark.rc
        sed -e s/@[email protected]/1.9.0-sid1/  -e s/@[email protected]/1,9,0,0/  < tsha
rk.rc.in > tshark.rc
        sed -e s/@[email protected]/1.9.0-sid1/  -e s/@[email protected]/1,9,0,0/  < raws
hark.rc.in > rawshark.rc
        sed -e s/@[email protected]/1.9.0-sid1/  -e s/@[email protected]/1,9,0,0/  < capi
nfos.rc.in > capinfos.rc
        sed -e s/@[email protected]/1.9.0-sid1/  -e s/@[email protected]/1,9,0,0/  < edit
cap.rc.in > editcap.rc
        sed -e s/@[email protected]/1.9.0-sid1/  -e s/@[email protected]/1,9,0,0/  < text
2pcap.rc.in > text2pcap.rc
        sed -e s/@[email protected]/1.9.0-sid1/  -e s/@[email protected]/1,9,0,0/  < merg
ecap.rc.in > mergecap.rc
        sed -e s/@[email protected]/1.9.0/  -e s/@[email protected]/1,9,0/  < wiretap.rc.in > w
iretap.rc
        sed -e s/@[email protected]/1.9.0-sid1/  -e s/@[email protected]/1,9,0,0/  < dump
cap.rc.in > dumpcap.rc
        sed -e s/@[email protected]/1.9.0-sid1/  -e s/@[email protected]/1,9,0,0/  < libw
sutil.rc.in > libwsutil.rc
        cd ..
        cd codecs
        "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\amd64\nmake.
exe" /                   -f Makefile.nmake

Microsoft (R) Program Maintenance Utility Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.

        cl -WX -DHAVE_CONFIG_H -D_U_="" /DPCAP_VERSION=4_1_2 /Zi /W3 /MD /DWIN32
_LEAN_AND_MEAN /DMSC_VER_REQUIRED=1600  /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTD
C_NO_DEPRECATE /MP /GS /w34295  /IC:\wireshark-win64-libs\gtk2\include\glib-2.0
 /IC:\wireshark-win64-libs\gtk2\lib\glib-2.0\include  -DG_DISABLE_DEPRECATED  -D
G_DISABLE_SINGLE_INCLUDES -Fd.\ -c G711u\G711udecode.c /FoG711udecode.obj
Microsoft (R) C/C++ Optimizing Compiler Version 16.00.40219.01 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

G711udecode.c
        cl -WX -DHAVE_CONFIG_H -D_U_="" /DPCAP_VERSION=4_1_2 /Zi /W3 /MD /DWIN32
_LEAN_AND_MEAN /DMSC_VER_REQUIRED=1600  /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTD
C_NO_DEPRECATE /MP /GS /w34295  /IC:\wireshark-win64-libs\gtk2\include\glib-2.0
 /IC:\wireshark-win64-libs\gtk2\lib\glib-2.0\include  -DG_DISABLE_DEPRECATED  -D
G_DISABLE_SINGLE_INCLUDES -Fd.\ -c G711a\G711adecode.c /FoG711adecode.obj
Microsoft (R) C/C++ Optimizing Compiler Version 16.00.40219.01 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

G711adecode.c
        link /lib /out:codecs.lib G711udecode.obj  G711adecode.obj
Microsoft (R) Library Manager Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.

        cd ..
        xcopy C:\wireshark-win64-libs\zlib125 zlib.tmp /D /I /E /Y
0 File(s) copied
        cd zlib.tmp
        "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\amd64\nmake.
exe" /                   -f win32/Makefile.msc zlib1.dll AS=ml64 LOC="-DASMV -DA
SMINF" OBJA="inffasx64.obj gvmat64.obj inffas8664.obj"

Microsoft (R) Program Maintenance Utility Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.

        link -nologo -debug -incremental:no -opt:ref -def:win32/zlib.def -dll -i
mplib:zdll.lib  -out:zlib1.dll -base:0x5A4C0000 adler32.obj compress.obj crc32.o
bj deflate.obj gzclose.obj gzlib.obj gzread.obj  gzwrite.obj infback.obj inflate
.obj inftrees.obj trees.obj uncompr.obj zutil.obj inffasx64.obj gvmat64.obj inff
as8664.obj zlib1.res
inffasx64.obj : fatal error LNK1112: module machine type 'x64' conflicts with ta
rget machine type 'X86'
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\Bin\amd64\link.EXE"' : return code '0x458'
Stop.
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\Bin\amd64\nmake.exe"' : return code '0x2'
Stop.

Can someone please tell me what I'm doing wrong?

asked 16 Dec '12, 22:13

SidR's gravatar image

SidR
245121722
accept rate: 30%

It worked! Thanks a lot! Can you convert your comment into an answer so that I can accept it?

(17 Dec '12, 01:13) SidR

If you have the dir C:\wireshark\zlib.tmp, try deleting that before building.

permanent link

answered 16 Dec '12, 22:49

Anders's gravatar image

Anders ♦
4.6k952
accept rate: 17%

I've been struggling with this link error for days until I found this solution. Just delete the zlib.tmp and rebuild. thank you!

(07 Oct '14, 13:43) christenmu
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • 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:

×110
×103
×27

question asked: 16 Dec '12, 22:13

question was seen: 3,230 times

last updated: 07 Oct '14, 13:43

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