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

issue of compiling wireshark source code with vs2013 under 64bit option

0

The environment is setted as below:

@echo off call "C:\Program Files (x86)\Microsoft Visual Studio12.0\Common7\Tools\VsDevCmd.bat"
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64
e:
cd E:\Wireshark_Plugin\Source\wireshark-master
set YES_I_KNOW_ABOUT_THE_DEPRECATION=1
set VISUALSTUDIOVERSION=12.0
set MSVC_VARIANT=MSVC2013EE
set CYGWIN_PATH=E:\Software\Cygwin\bin
set WIRESHARK_BASE_DIR=E:\Wireshark_Plugin\Source\wireshark-master
set WIRESHARK_TARGET_PLATFORM=win64
set QT5_BASE_DIR=E:\Software\QT\5.6\msvc2013_64
::nmake -f Makefile.nmake verify_tools
::nmake -f Makefile.nmake setup
::nmake -f Makefile.nmake distclean
nmake -f Makefile.nmake all
pause

The compile result showed as below which is failed

Microsoft (R) Program Maintenance Utility Version 12.00.21005.1 Copyright (C) Microsoft Corporation. All rights reserved.
cd ..
xcopy E:\Wireshark_Plugin\Source\wireshark-master\Wireshark-win64-libs\zlib-1.2.8-ws zlib.tmp /D /I /E /Y

cd zlib.tmp
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\nmake.exe" /
           -f win32/Makefile.msc zlib1.dll AS=ml64 LOC="-I. -DASMV -DASMINF" OBJA="inffasx64.obj gvmat64.obj inffas8664.obj"

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

ml64 -c -coff -Zi -I. -DASMV -DASMINF ./contrib/masmx64\inffasx64.asm

'ml64' is not internal or external command

NMAKE : fatal error U1077: 'ml64' : return code '0x1' Stop. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0 \VC\BIN\nmake.exe"' : return code '0x2' Stop.

Does anybody has the same problem as me.I was confused about for almost one week,hope someone may help me. Thanks all.

By the way ,it has compiled successfully under 32bit option. then environment setting is as below:

call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\vcvars32.bat"
e:
cd E:\Wireshark_Plugin\Source\wireshark-master
set YES_I_KNOW_ABOUT_THE_DEPRECATION=1
set VISUALSTUDIOVERSION=12.0
set MSVC_VARIANT=MSVC2013EE
set CYGWIN_PATH=E:\Software\Cygwin\bin
set WIRESHARK_BASE_DIR=E:\Wireshark_Plugin\Source\wireshark-master
set WIRESHARK_TARGET_PLATFORM=win32
set QT5_BASE_DIR=E:\Software\QT\5.6\msvc2013_64
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86
::nmake -f Makefile.nmake verify_tools
::nmake -f Makefile.nmake setup
::nmake -f Makefile.nmake distclean
nmake -f Makefile.nmake all
pause

asked 13 May ‘16, 00:30

Water's gravatar image

Water
6447
accept rate: 0%

edited 13 May ‘16, 02:16

grahamb's gravatar image

grahamb ♦
19.8k330206


2 Answers:

0

First off, you should really move to CMake builds ASAP, nmake will be going away soon.

Next, you have some odd env vars set there, some aren't even required.

call "C:\Program Files (x86)\Microsoft Visual Studio12.0\Common7\Tools\VsDevCmd.bat", no point in doing this, the call to vcvarsall.bat does the job.

set VISUALSTUDIOVERSION=12.0, this should be set by the call to ..\vcvarsall.bat amd64.

set MSVC_VARIANT=MSVC2013EE, this should be manually set in config.nmake.

set CYGWIN_PATH=E:\Software\Cygwin\bin, this should be manually set in config.nmake.

set WIRESHARK_BASE_DIR=E:\Wireshark_Plugin\Source\wireshark-master, this should normally be set to something outside of your source tree, but I don't think it's the cause of your issue.

The build failure is an inability to run the Visual Studio x64 macro assembler. From your build command prompt, typing "ml64" should get output like:

C:\Users\graham>ml64
Microsoft (R) Macro Assembler (x64) Version 12.00.31101.0
Copyright (C) Microsoft Corporation.  All rights reserved.

usage: ML64 [ options ] filelist [ /link linkoptions] Run "ML64 /help" or "ML64 /?" for more info

If that doesn’t happen, then there’s something up with your build environment or VS install, ml64.exe should be in C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\ml64.exe and the directory C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64 should be on your path (added by vcvarsall.bat).

answered 13 May ‘16, 02:33

grahamb's gravatar image

grahamb ♦
19.8k330206
accept rate: 22%

Hi grahamb, I modified " amd64" to “x86_amd64” in the bat file,and the problem disappeared. I think it is a command prompt environment problem. But another Link problem happened, below is the error description,please kindly help me have a check,what mistake I have made.

Any suggestion and feedback from you are appreciated.Thank you again.

'libwritecap.lib' is up-to-date
    cd ..
    cd extcap
    "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\nmake.exe" /
               /f Makefile.nmake all

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

Linking ciscodump.exe link @C:\Users\ADMINI~1\AppData\Local\Temp\nm6B80.tmp ciscodump.obj : error LNK2019: unresolved external symbol libpcap_write_file_header referenced in function ssh_open_remote_connection ciscodump.obj : error LNK2019: unresolved external symbol libpcap_write_packet referenced in function ssh_loop_read ciscodump.exe : fatal error LNK1120: 2 unresolved externals NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0 \VC\BIN\x86_amd64\link.EXE"' : return code '0x460' Stop. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0 \VC\BIN\nmake.exe"' : return code '0x2' Stop.

(29 May ‘16, 22:32) Water
1

Your answer has been converted to a comment as that’s how this site works. Please read the FAQ for more information. Also, please pay attention to formatting, which makes replies/comments actually readable.

(30 May ‘16, 01:51) Jaap ♦
1

Try doing a “clean” or “distclean”. I note you’re still using nmake, this is planned to be removed from the master branch in the near future.

(30 May ‘16, 02:23) grahamb ♦

I tried to compile with Cmake, Sir.But also some problems happened.Did you have such kind experience,Any suggestions from you are appreciated.Thanks indeed.

(31 May ‘16, 19:52) Water

0

Thanks you all for paying attention my question.I have resolved this issue. It seems the Unicode setting problem. Go to Control Panel->Region and Language->Language for the non-Unicode programs In "Current language for non-Unicode programs", Change to "English(United States)".

answered 05 Jun '16, 18:13

Water's gravatar image

Water
6447
accept rate: 0%