我在运行verify_tools
时遇到问题,无法在Windows上构建Wireshark。 makefile因以下错误而失败,无法找到文件。
C:\Development\wireshark>nmake -f Makefile.nmake verify_tools
Microsoft (R) Program Maintenance Utility Version 10.00.40219.01
Copyright (C) Microsoft Corporation. All rights reserved.
tools/win64-setup.sh: line 12: /cygdrive/c/Development/wireshark/tools/win-setup: No such file or directory
tools/win64-setup.sh: line 12: exec: /cygdrive/c/Development/wireshark/tools/win: cannot execute: No such file or directory
tools/win64-setup.sh: line 12: /cygdrive/c/Development/wireshark/tools/win-setup: No such file or directory
tools/win64-setup.sh: line 12: exec: /cygdrive/c/Development/wireshark/tools/win: cannot execute: No such file or directory
NMAKE : fatal error U1077: 'C:\Users\indiv\apps\cygwin\bin\bash.EXE' : return code '0x7e'
Stop.
要进行调试,我更改了win64-setup.sh并将其打印为WIN_SETUP
。
echo WIN_SETUP: [$WIN_SETUP]
exec $WIN_SETUP $@
结果很奇怪。可能是因为某些行尾问题。
C:\Development\wireshark>nmake -f Makefile.nmake verify_tools
Microsoft (R) Program Maintenance Utility Version 10.00.40219.01
Copyright (C) Microsoft Corporation. All rights reserved.
]IN_SETUP: [tools/win-setup.sh
如何修复或解决此问题?
答案 0 :(得分:0)
Wireshark构建依赖于来自cygwin的所有支持实用程序,cl
,link
和nmake
除外。您的路径设置为一些支持实用程序来自您环境中的其他位置。就像安装gnuwin32或其他东西一样。
为了便于说明,我们假设变量CYGWIN
设置为您的cygwin路径,例如c:\cygwin\bin
。
你可能正在做这样的事情,正如Wireshark维基所建议的那样:
set PATH=%PATH%;%CYGWIN%
call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /Release /x64
不是这样做,而是先在路径搜索顺序中移动cygwin,以便可执行文件始终来自那里。然后设置Windows构建环境,以便Microsoft link
出现在cygwin的link
之前。
set PATH=%CYGWIN%;%PATH%
call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /Release /x64
请勿忘记进行这些更改以重新启动shell以完全擦除旧环境,因为SetEnv.cmd
可能已缓存旧环境,这会阻止您更改%PATH%
。< / p>
然后当你运行verify_tools规则时,你得到了这个:
c:\Development\wireshark>nmake -f Makefile.nmake verify_tools
Microsoft (R) Program Maintenance Utility Version 10.00.40219.01
Copyright (C) Microsoft Corporation. All rights reserved.
Checking for required applications:
cl: /cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/Bin/cl
link: /cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/Bin/link
nmake: /cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/Bin/nmake
bash: /usr/bin/bash
bison: /usr/bin/bison
flex: /usr/bin/flex
env: /usr/bin/env
grep: /usr/bin/grep
/usr/bin/find: /usr/bin/find
peflags: /usr/bin/peflags
perl: /usr/bin/perl
sed: /usr/bin/sed
unzip: /usr/bin/unzip
wget: /usr/bin/wget