构建 Wireshark 时的错误和警告

Errors and Warnings while building Wireshark

我正在尝试按照此处给出的步骤在 Windows 上构建 Wireshark - https://www.wireshark.org/docs/wsdg_html_chunked/ChSetupWin32.html。但是我 运行 在构建 Wireshark 的过程中出现了奇怪的错误和警告。我得到的错误如下所述。

 "C:\Development\wsbuild64\Wireshark.sln" (default target) (1) ->
   "C:\Development\wsbuild64\text2pcap.vcxproj.metaproj" (default target) (44) ->
   "C:\Development\wsbuild64\text2pcap.vcxproj" (default target) (90) ->
   (ClCompile target) ->
     C:/Development/wsbuild64/text2pcap-scanner.c(993): error C2220: warning treated as error - no 'object' file ge
   nerated [C:\Development\wsbuild64\text2pcap.vcxproj]


   "C:\Development\wsbuild64\Wireshark.sln" (default target) (1) ->
   "C:\Development\wsbuild64\wiretap\wiretap.vcxproj.metaproj" (default target) (56) ->
   "C:\Development\wsbuild64\wiretap\wiretap.vcxproj" (default target) (87) ->
     C:/Development/wsbuild64/wiretap/ascend.c(429): error C2220: warning treated as error - no 'object' file gener
   ated [C:\Development\wsbuild64\wiretap\wiretap.vcxproj]

我也收到了一些如下所述的警告。

"C:\Development\wsbuild64\Wireshark.sln" (default target) (1) ->
   "C:\Development\wsbuild64\text2pcap.vcxproj.metaproj" (default target) (44) ->
   "C:\Development\wsbuild64\text2pcap.vcxproj" (default target) (90) ->
   (ClCompile target) ->
     C:/Development/wsbuild64/text2pcap-scanner.c(993): warning C4003: not enough arguments for function-like macro
    invocation 'text2pcap_wrap' [C:\Development\wsbuild64\text2pcap.vcxproj]


   "C:\Development\wsbuild64\Wireshark.sln" (default target) (1) ->
   "C:\Development\wsbuild64\wiretap\wiretap.vcxproj.metaproj" (default target) (56) ->
   "C:\Development\wsbuild64\wiretap\wiretap.vcxproj" (default target) (87) ->
     C:/Development/wsbuild64/wiretap/ascend.c(429): warning C4273: 'malloc': inconsistent dll linkage [C:\Developm
   ent\wsbuild64\wiretap\wiretap.vcxproj]
     C:/Development/wsbuild64/wiretap/ascend.c(436): warning C4273: 'free': inconsistent dll linkage [C:\Developmen
   t\wsbuild64\wiretap\wiretap.vcxproj]

我尝试使用以下命令构建这个东西,这样我就不会收到错误警告。但我仍然遇到同样的错误并且构建失败 -

msbuild /m /warnasmessage:C2220 /p:Configuration=RelWithDebInfo Wireshark.sln

遇到这种情况怎么办?

如果有人遇到同样的问题,请确保在尝试构建 Wireshark 之前安装了所有必需的包。在这种情况下,我忘记安装 Perl、Bison 和 Flex。