Wireshark-dev: Re: [Wireshark-dev] Help, I still can't build Wireshark under Windows XP
From: "Josh Moore" <jmoore@xxxxxxxxxxxx>
Date: Fri, 28 Mar 2008 11:47:22 -0500
Hey John,

Obviously, the output you are seeing is still not explicitly narrowing
down the problem to a particular file. I have tried compiling the
following versions:
24602: This one had the issues I put on the mailing list earlier.
24657: I checked out this when you had problems with it. I couldn't get
as far in the compile process as you did due to warnings in
tools/lemon/lemon.c about usage of sprintf(). (This may be because I'm
using VS2005Pro w/ SP1.)
24729: This one worked best for me.

There are a couple of things you can try:
1. Check out the head revision (although the build bot just spotted a
problem with this version?) or 24729 (shown above) and try that instead.
2. Install the service pack (Service Pack 1) for Microsoft Visual Studio
2005:
http://www.microsoft.com/downloads/details.aspx?familyid=7B0B0339-613A-4
6E6-AB4D-080D4D4A8C4E&displaylang=en (up to 150MB download). There has
been no need of this mentioned anywhere yet, but it may be worth trying.
3. Try to figure out what code is created immediately after compiling
epan/dissectors/packet-dcerpc-nt.c and what goes wrong with it in your
current setup. Epan/dissectors/Makefile.common ends with
DISSECTOR_SUPPORT_SRC being defined with packet-dcerpc-nt.c being a part
of that definition:

----------------------------------------------
# Dissector helpers.  They're included in the source files in this
# directory, but they're not dissectors themselves, i.e. they're not
# used to generate "register.c").
DISSECTOR_SUPPORT_SRC = \
        packet-dcerpc-nt.c \
        register.c
----------------------------------------------

This would seem to point to register.c as being a problem?

Makefile.nmake and Makefile.am both use DISSECTOR_SUPPORT_SRC.
Makefile.am uses it in defining libdissectors_la_SOURCES:

----------------------------------------------
libdissectors_la_SOURCES = \
        $(DISSECTOR_SRC) \
        $(DISSECTOR_SUPPORT_SRC)
----------------------------------------------

Makefile.am uses DISSECTOR_SUPPORT_SRC in defining
DISSECTOR_SUPPORT_OBJECTS:

----------------------------------------------
DISSECTOR_SUPPORT_OBJECTS = \
        $(DISSECTOR_SUPPORT_SRC:.c=.obj)

dissectors.lib: register.obj packet-ncp2222.c $(GENERATED_HEADER_FILES)
../../config.h $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS)
        @echo Linking dissectors.lib $(DISSECTOR_OBJECTS)
$(DISSECTOR_SUPPORT_OBJECTS)
        link /lib /out:dissectors.lib $(DISSECTOR_OBJECTS)
$(DISSECTOR_SUPPORT_OBJECTS)
----------------------------------------------

I hope this sheds at least some light on what nmake is doing after
compiling packet-dcerpc-nt.c.

Your verify_tools output looks good; it's the same as mine (character
for character).

Your batch program is very similar to my own:
@echo off
"C:\Program Files\Microsoft Platform SDK for Windows Server 2003
R2\SetEnv.Cmd"
"C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat"
cd C:\wireshark

The last line, which is supposed to change to the wireshark folder,
doesn't do anything useful because the current folder is lost when the
batch program exits, but this is irrelevant.

Your Path looks OK. Before the script is run, mine is:
PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program
Files\NTRU Cryptosystems\NTRU TCG Software Stack\bin\;C:\Program
Files\Wave Systems Corp\Dell Preboot Manager\Access
Client\v5\;C:\Program Files\Common Files\Autodesk
Shared\;C:\Xilinx92i\bin\nt;C:\Program Files\OpenVPN\bin

After the script is run, my path is:

PATH=C:\Program Files\Microsoft Platform SDK for Windows Server 2003
R2\Bin;C:\Program Files\Microsoft Platform SDK for Windows Server 2003
R2\Bin\WinNT;C:\Program Files\Microsoft Visual Studio
8\Common7\IDE;C:\Program Files\Microsoft Visual Studio
8\VC\BIN;C:\Program Files\Microsoft Visual Studio
8\Common7\Tools;C:\Program Files\Microsoft Visual Studio
8\Common7\Tools\bin;C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\bin;C:\Program Files\Microsoft Visual Studio 8
\SDK\v2.0\bin;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\Program
Files\Microsoft Visual Studio
8\VC\VCPackages;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;
C:\Program Files\NTRU Cryptosystems\NTRU TCG Software
Stack\bin\;C:\Program Files\Wave Systems Corp\Dell Preboot
Manager\Access Client\v5\;C:\Program Files\Common Files\Autodesk
Shared\;C:\Xilinx92i\bin\nt;C:\Program Files\OpenVPN\bin

For comparison, yours (before the script items) was:

path
c:\cygwin\bin;c:\batch;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem
;C:\subversion-
1.4.6;

Yours has cygwin and subversion, while mine does not, but that shouldn't
be causing this problem. We have different versions of windows, and I
have a whole bunch of junk in my path, but again, those should not
affect the problem. (Note that I don't have a command-line subversion
client because I use TortiseSVN: http://tortoisesvn.net/downloads . )

Sorry I couldn't be of more help as I am not able to reproduce the
problem.

Josh Moore

John Wang wrote:

-----Original Message-----
From: wireshark-dev-bounces@xxxxxxxxxxxxx
[mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] On Behalf Of
wireshark-dev-request@xxxxxxxxxxxxx
Sent: Thursday, March 27, 2008 7:30 PM

Date: Fri, 28 Mar 2008 10:59:16 +1030
From: "John Wang" <locationdev@xxxxxxxxx>
Subject: Re: [Wireshark-dev] Help,	I still can't build Wireshark
under
	Windows XP
To: "Developer support list for Wireshark"
	<wireshark-dev@xxxxxxxxxxxxx>
Message-ID:
	<68002a310803271729m129f88cbx9ec711e5f2675f2d@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset="iso-8859-1"

Hi,

sorry, didn't reply earlier.

I start with a batch program to initialize the environment, and I don't
think it can cause the problem:
------------------------------------------------------------------------
----------------------------------------
initialize.bat
path
c:\cygwin\bin;c:\batch;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem
;C:\subversion-
1.4.6;
call "C:\Program Files\Microsoft Platform SDK for Windows Server 2003
R2\SetEnv.Cmd"
::set environment variables of Platform SDK Server 2003
call "C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat"
::set environment variable of Visual C++ 2005 Express Edition
cd C:\wireshark
------------------------------------------------------------------------
--------------------------------------------------------
C:\>cd batch

C:\batch>initialize
set environment and current dir

Attempting to detect a Microsoft Visual Studio installation


Targeting Windows XP 32 DEBUG

Setting environment for using Microsoft Visual Studio 2005 x86 tools
------------------------------------------------------------------------
---------------------------------------------------

run verify_tools

C:\wireshark>nmake -f Makefile.nmake verify_tools

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

Checking for required applications:
        cl: /cygdrive/c/Program Files/Microsoft Visual Studio
8/VC/BIN/cl
        link: /cygdrive/c/Program Files/Microsoft Visual Studio
8/VC/BIN/link
        nmake: /cygdrive/c/Program Files/Microsoft Visual Studio
8/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
        perl: /usr/bin/perl
        C:/python24/python.exe: /cygdrive/c/python24/python.exe
        sed: /usr/bin/sed
        unzip: /usr/bin/unzip
        wget: /usr/bin/wget
------------------------------------------------------------------------
----------------------------------------------------------------
run nmake -f Makefile.nmake setup to install the libraries

run nmake -f Makefile.nmake distclean

run nmake -f Makefile.nmake all to build

------------------------------------------------------------------------
--------------------------------------------------------------------
C:\wireshark>nmake -f Makefile.nmake all

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

        "C:\Program Files\Microsoft Visual Studio 8\VC\BIN\nmake.exe" /
          -f Makefile.nmake WIN32_SETUP_OPT=--libverify process_libs

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

        if not exist C:\wireshark-win32-libs md C:\wireshark-win32-libs

Wireshark is ready to build.
        sed -e s/@VERSION@/0.99.9/  -e "s/@HAVE_GNU_ADNS@/#define
HAVE_GNU_ADNS
1/"  -e "s/@HAVE_PCRE@/#define HAVE_LIBPCRE 1/"  -e
"s/@HAVE_KFW@/#define
HAVE_M
IT_KERBEROS 1/"  -e "s/@HAVE_NETTLE@//"  -e "s/@HAVE_LIBZ@/#define
HAVE_LIBZ
1/"
  -e "s/@HAVE_LIBPCAP@/#define HAVE_LIBPCAP 1/"  -e "s/@HAVE
_PCAP_FINDALLDEVS@/#
define HAVE_PCAP_FINDALLDEVS 1/"  -e "s/@HAVE
_PCAP_DATALINK_NAME_TO_VAL@/#define
 HAVE_PCAP_DATALINK_NAME_TO_VAL 1/"  -e "s/@HAVE
_PCAP_DATALINK_VAL_TO_NAME@/#def
ine HAVE_PCAP_DATALINK_VAL_TO_NAME 1/"  -e "s/@HAVE_PCAP_BREAKLOOP@//"
-e "
s/@H
AVE_REMOTE@//"  -e "s/@HAVE_PCAP_REMOTE@//"  -e "s/@HAVE_PCAP_OPEN@//"
-e "
s/@H
AVE_PCAP_FINDALLDEVS_EX@//"  -e "s/@HAVE_PCAP_CREATESRCSTR@//"  -e
"s/@HAVE
_PCAP
_SETSAMPLING@//"  -e "s/@HAVE_LIBWIRESHARKDLL@/#define
HAVE_LIBWIRESHARKDLL
1/"
 -e "s/@WPCAP_CONSTIFIED@/#define WPCAP_CONSTIFIED 1/"  -e "s/@HAVE
_LIBGNUTLS@/#
define HAVE_LIBGNUTLS 1/"  -e "s/@HAVE_LIBGCRYPT@/#define HAVE_LIBGCRYPT
1/"  -e
 "s/@HAVE_LUA@/#define HAVE_LUA 1/"  -e "s/@HAVE_LUA_5_1@/#define
HAVE_LUA_5_1 1
/"  -e "s/@HAVE_AIRPCAP@/#define HAVE_AIRPCAP 1/"  -e "s/@HAVE
_AIRPDCAP@/#define
 HAVE_AIRPDCAP 1/"  -e "s/@HAVE_LIBPORTAUDIO@/#define HAVE_LIBPORTAUDIO
1/"
-e
"s/@PORTAUDIO_API_1@//"  -e "s/@HAVE_SMI@/#define HAVE_LIBSMI 1/"  <
config.h.wi
n32 > config.h
        cd tools
        "C:\Program Files\Microsoft Visual Studio 8\VC\BIN\nmake.exe" /
          -f Makefile.nmake

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

        cd lemon
        "C:\Program Files\Microsoft Visual Studio 8\VC\BIN\nmake.exe" /
          -f Makefile.nmake

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

        cl -WX -D_U_="" /Zi /W3 /MD /D_CRT_SECURE_NO_DEPRECATE
/D_CRT_NONSTDC_NO
_DEPRECATE /DMSC_VER_REQUIRED=1400 lemon.c


......................


packet-q933.c
packet-qllc.c
packet-quake.c
packet-quake2.c
packet-quake3.c
packet-quakeworld.c
packet-radius.c
packet-radius_packetcable.c
packet-radiotap.c
packet-raw.c
packet-rdm.c
packet-rdt.c
packet-redback.c
Generating Code...
Compiling...
packet-redbackli.c
packet-retix-bpdu.c
packet-rgmp.c
packet-rip.c
packet-ripng.c
packet-rlogin.c
packet-rmcp.c
packet-rmi.c
packet-rmp.c
packet-rmt-alc.c
packet-rmt-common.c
packet-rmt-fec.c
packet-rmt-lct.c
packet-rmt-norm.c
packet-roofnet.c
packet-rpc.c
packet-rpl.c
packet-rquota.c
packet-rsh.c
packet-rsl.c
Generating Code...
Compiling...
packet-rstat.c
packet-rsvp.c
packet-rsync.c
packet-rtcp.c
packet-rtmpt.c
packet-rtp-events.c
packet-rtp.c
packet-rtps.c
packet-rtsp.c
packet-rwall.c
packet-rx.c
packet-s5066.c
packet-sadmind.c
packet-sap.c
packet-sccpmg.c
packet-scsi.c
packet-scsi-mmc.c
packet-scsi-sbc.c
packet-scsi-smc.c
packet-scsi-ssc.c
Generating Code...
Compiling...
packet-sdlc.c
packet-sdp.c
packet-sebek.c
packet-ses.c
packet-sflow.c
packet-sip.c
packet-sigcomp.c
packet-sipfrag.c
packet-sita.c
packet-skinny.c
packet-slimp3.c
packet-sll.c
packet-slowprotocols.c
packet-slsk.c
packet-smb-browse.c
packet-smb-common.c
packet-smb-logon.c
packet-smb-mailslot.c
packet-smb-pipe.c
packet-smb-sidsnooping.c
Generating Code...
Compiling...
packet-smb.c
packet-smb2.c
packet-smpp.c
packet-smtp.c
packet-sna.c
packet-snaeth.c
packet-sndcp.c
packet-socks.c
packet-spp.c
packet-spray.c
packet-srp.c
packet-sscf-nni.c
packet-srvloc.c
packet-sscop.c
packet-scriptingservice.c
packet-ssh.c
packet-ssl.c
packet-ssl-utils.c
packet-starteam.c
packet-stat-notify.c
Generating Code...
Compiling...
packet-stat.c
packet-stun.c
packet-stun2.c
packet-sua.c
packet-symantec.c
packet-synergy.c
packet-syslog.c
packet-t30.c
packet-t38.c
packet-tacacs.c
packet-tali.c
packet-tapa.c
packet-tcp.c
packet-tds.c
packet-teimanagement.c
packet-telnet.c
packet-teredo.c
packet-text-media.c
packet-telkonet.c
packet-tftp.c
Generating Code...
Compiling...
packet-time.c
packet-tipc.c
packet-tivoconnect.c
packet-tnef.c
packet-tns.c
packet-tpkt.c
packet-tpncp.c
packet-tr.c
packet-trmac.c
packet-tsp.c
packet-tuxedo.c
packet-tzsp.c
packet-ucp.c
packet-udld.c
packet-uma.c
packet-udp.c
packet-usb.c
packet-usb-masstorage.c
packet-umts_fp.c
packet-uts.c
Generating Code...
Compiling...
packet-v120.c
packet-vines.c
packet-vj.c
packet-vlan.c
packet-vnc.c
packet-vrrp.c
packet-vtp.c
packet-wap.c
packet-wbxml.c
packet-wccp.c
packet-wcp.c
packet-wfleet-hdlc.c
packet-who.c
packet-windows-common.c
packet-winsrepl.c
packet-wlccp.c
packet-wol.c
packet-wps.c
packet-wsp.c
packet-wtls.c
Generating Code...
Compiling...
packet-wtp.c
packet-x11.c
packet-x25.c
packet-x29.c
packet-xcsl.c
packet-xdmcp.c
packet-xml.c
packet-xot.c
packet-xyplex.c
packet-yhoo.c
packet-ymsg.c
packet-ypbind.c
packet-yppasswd.c
packet-ypserv.c
packet-ypxfr.c
packet-zebra.c
packet-dcerpc-atsvc.c
packet-dcerpc-budb.c
packet-dcerpc-butc.c
packet-dcerpc-dfs.c
Generating Code...
Compiling...
packet-dcerpc-drsuapi.c
packet-dcerpc-dssetup.c
packet-dcerpc-efs.c
packet-dcerpc-eventlog.c
packet-dcerpc-initshutdown.c
packet-dcerpc-lsa.c
packet-dcerpc-nspi.c
packet-dcerpc-srvsvc.c
packet-dcerpc-winreg.c
packet-dcerpc-wkssvc.c
packet-dcerpc-wzcsvc.c
packet-acp133.c
packet-acse.c
packet-ansi_map.c
packet-ansi_tcap.c
packet-camel.c
packet-cdt.c
packet-cmip.c
packet-cmp.c
packet-cms.c
Generating Code...
Compiling...
packet-crmf.c
packet-ctdb.c
packet-dap.c
packet-disp.c
packet-dop.c
packet-dsp.c
packet-erf.c
packet-ess.c
packet-ftam.c
packet-gnm.c
packet-gsm_map.c
packet-h225.c
packet-h235.c
packet-h245.c
packet-h248.c
packet-h282.c
packet-h283.c
packet-h323.c
packet-h450.c
packet-h450-ros.c
Generating Code...
Compiling...
packet-h460.c
packet-h501.c
packet-inap.c
packet-ldap.c
packet-logotypecertextn.c
packet-mms.c
packet-mpeg-audio.c
packet-mpeg-pes.c
packet-nbap.c
packet-ns_cert_exts.c
packet-ocsp.c
packet-p7.c
packet-pcap.c
packet-pkcs12.c
packet-pkcs1.c
packet-pkinit.c
packet-pkix1explicit.c
packet-pkix1implicit.c
packet-pkixproxy.c
packet-pkixqualified.c
Generating Code...
Compiling...
packet-pkixtsp.c
packet-pres.c
packet-q932.c
packet-q932-ros.c
packet-qsig.c
packet-ranap.c
packet-rnsap.c
packet-ros.c
packet-rrlp.c
packet-rtse.c
packet-s1ap.c
packet-s4406.c
packet-sabp.c
packet-smrse.c
packet-snmp.c
packet-spnego.c
packet-t125.c
packet-tcap.c
packet-ulp.c
packet-wlancertextn.c
Generating Code...
Compiling...
packet-x2ap.c
packet-x224.c
packet-x411.c
packet-x420.c
packet-x509af.c
packet-x509ce.c
packet-x509if.c
packet-x509sat.c
packet-dcerpc-nt.c
Generating Code...
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
8\VC\BIN\c
l.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
8\VC\BIN\n
make.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
8\VC\BIN\n
make.exe"' : return code '0x2'
Stop.

C:\wireshark>

------------------------------------------------------------------------
------------------------------------------------------------------------
--
this error occurred when I built the version:  r24657.

Thanks for your help

Cheers

John