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

Hello,

I'm trying to build Wireshark on a Windows 7 machine, but the build fails when I try to run the nmake -f Makefile.nmake all command. The error message is:

sed -e s/@[email protected]/1.10.3kp/  -e s/@[email protected]/1/  -e s/@[email protected]/10/  -e s/@[email protected]/3/  -e "s/@[email protected]/#define HAVE_C_ARES 1/"  -e "s/@[email protected]//"  -e "s/@[email protected]//"  -e "s/@[email protected]//"  -e "s/@[email protected]/#define HAVE_LIBZ 1/"  -e "s/@[email protected]/#define HAVE_LIBPCAP 1/"  -e "s/@[email protected]/#define HAVE_PCAP_FINDALLDEVS 1/"  -e "s/@[email protected]/#define HAVE_PCAP_DATALINK_NAME_TO_VAL 1/"  -e "s/@[email protected]/#define HAVE_PCAP_DATALINK_VAL_TO_NAME 1/"  -e "s/@[email protected]/#define HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION 1/"  -e "s/@[email protected]//"  -e "s/@[email protected]/#define HAVE_REMOTE 1/"  -e "s/@[email protected]/#define HAVE_PCAP_REMOTE 1/"  -e "s/@[email protected]/#define HAVE_PCAP_OPEN 1/"  -e "s/@[email protected]/#define HAVE_PCAP_OPEN_DEAD 1/"  -e "s/@[email protected]/#define HAVE_PCAP_LIST_DATALINKS 1/"  -e "s/@[email protected]/#define HAVE_PCAP_FREE_DATALINKS 1/" -e "s/@[email protected]/#define HAVE_PCAP_SET_DATALINK 1/"  -e "s/@[email protected]/#define HAVE_PCAP_SETSAMPLING 1/"  -e "s/@[email protected]/#define HAVE_BPF_IMAGE 1/"  -e "s/@[email protected]/#define HAVE_LIBGNUTLS 1/"  -e "s/@[email protected]/#define HAVE_LIBGCRYPT 1/"  -e "s/@[email protected]/#define HAVE_LUA1/"  -e "s/@[email protected]/#define HAVE_LUA 1/"  -e "s/@[email protected]//"  -e "s/@[email protected]/#define HAVE_AIRPCAP 1/"  -e "s/@[email protected]//"  -e "s/@[email protected]/#define HAVE_LIBPORTAUDIO 1/"  -e "s/@[email protected]//"  -e "s/@[email protected]/#define HAVE_LIBSMI 1/"  -e "s/@[email protected]/#define HAVE_GEOIP 1/"  -e "s/@[email protected]/#define HAVE_GEOIP_V6 1/"  -e "s/@[email protected]/#define HAVE_SOFTWARE_UPDATE 1/"  -e "s/@[email protected]/#define INET6 1/"  -e "s/@[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

The system cannot find the file specified.

NMAKE : fatal error U1077: 'sed' : return code '0x1'
Stop.

verify_tools and distclean work well, but now I'm unable to find what causes this problem. Which file is the one I'm missing? I have checked and the config.h.win32 is available and present in the directory I'm trying to build Wireshark.

My system is a 64-bit Windows 7 and I get this same error message whether I try to build a 32-bit or 64-bit version of Wireshark.

asked 21 Nov '13, 05:40

Arttu%20Leinonen's gravatar image

Arttu Leinonen
11114
accept rate: 100%

edited 22 Nov '13, 04:48

grahamb's gravatar image

grahamb ♦
19.8k330206

Please post the output of verify_tools

(21 Nov '13, 07:26) Bill Meier ♦♦

To my knowledge it follows what is usual:

C:\wiresharkdev>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
C:\Python27\python.exe: /cygdrive/c/Python27/python.exe
sed: /usr/bin/sed
unzip: /usr/bin/unzip
wget: /usr/bin/wget

I first ran into problems with unzip being found under TexLive, but I solved that by prepending the cygwin path instead of appending when I set the environment up.

(21 Nov '13, 23:25) Arttu Leinonen

Ok, I found the root cause of the problem.

At some point I had tried to ease my workflow by setting up command prompt to automatically change the directory to the one I needed. Of course I had forgotten this altogether, so when bash was running sed and tried to access config.h.win32, it could find it.

The problem was that the make process starts up many cmd processes and at some point the autorun commands were run which caused the working directory change so that the required file was nowhere to be found. Removing the autorun key from registry cleared up the problem.

So in the end this was a stupid mistake on my part. Sorry for the inconvenience to everybody.

permanent link

answered 25 Nov '13, 01:54

Arttu%20Leinonen's gravatar image

Arttu Leinonen
11114
accept rate: 100%

See the answer to a similar question (almost same error message)

http://ask.wireshark.org/questions/7991/nmake-fatal-error-u1077-sed-return-code-0x1

Regards
Kurt

permanent link

answered 21 Nov '13, 07:31

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
24.8k1039237
accept rate: 15%

edited 21 Nov '13, 07:34

Unfortunately that question/answer was when sed wasn't being found properly. It did help solve a problem with bash finding a wrong version of unzip, but both cmd.exe and bash seem to find the sed-program as required.

It seems that the problem is that sed cannot find some file that it tries to find but as I'm able to see and if needed touch the config.h.win32 which to my understanding is the only file truly being used in that command, I don't know how to solve this.

Yours, Arttu

(21 Nov '13, 23:32) Arttu Leinonen

O.K. please check:

  • is there a config.h (generated by sed). If so: delete it and run nmake again
  • if there is no config.h, run sed manually (copy-paste from your question). What do you get?

BTW: Do you have the standard windows cmd.exe or some 'enhancement tool' like 4DOS (or similar)?

(22 Nov '13, 01:57) Kurt Knochner ♦

There wasn't a config.h file. I also tried creating an empty file and forcing make to regenerate it, but it didn't work.

Running the actual command straight off seems to work, as it generates a config.h file that seems to contain all the required parts, but now nmake is running to a different error about native-nmake.CMD not being a command, but that I believe I've seen as a question elsewhere, so I will try to find a solution to it.

Still a weird problem that invoking the command from the makefile fails, but invoking it outside works as it is supposed to.

P.S. Yes I have a native cmd.exe. At least it says it is cmd.exe and I don't remember installing anything that would supplant it.

(22 Nov '13, 02:08) Arttu Leinonen

I still believe nmake does not find sed (for whatever reason).

Please try this: in Makefile.nmake replace the following line

        sed -e s/@[email protected]/$(VERSION)/ \

with

        sed -xxx -e s/@[email protected]/$(VERSION)/ \

then run nmake again. What is the error message?

If nmake finds sed, it should be a different error message/code (as sed does not know -xxx).

If it's the same error message/code, nmake does not find sed and probably other tools neither.

(22 Nov '13, 02:19) Kurt Knochner ♦

I did that, and after first running distclean, to get rid of the config.h the error message did stay the same, with the added -xxx on the first row. It still complains about finding the file.

This would also be consistent with lemon compilation failing as it is unable to find the ../native-nmake.cmd or at least recognizing it as an executable.

Hummm...I think the next step would be reinstalling cygwin from scratch, if you do not have any better idea?

(22 Nov '13, 02:33) Arttu Leinonen

Hummm...I think the next step would be reinstalling cygwin from scratch, if you do not have any better idea?

well, you could try to trace nmake with process explorer (set a filter on nmake.exe) to figure our where it looks for sed. However that output would be rather huge.

(22 Nov '13, 02:36) Kurt Knochner ♦

It seems that manually calling the correct sed executable with the correct command line does work, so I suspect some environment issue.

You also stated that you manually added cygwin to the path, that isn't normally necessary as config.nmake does that for you (look for # Construct the path), although it does append cygwin, so any utils that are on the path will get picked up before cygwin.

Maybe you could try cleaning up your path in the command prompt you're using (remove cygwin and paths to other "bad" executables that get picked up) and try again?

(22 Nov '13, 02:44) grahamb ♦

Thank you Graham, by the way, for cleaning up my original question.

Actually I did it because it is mentioned as something that needs to be done in the Developer's Guide. I suspect that nmake verify_tools wouldn't be able to find the unix side tools without cygwin being added to the path before hand.

I'll look into cleaning up my path. I already uninstalled TexLive that had been first causing me some problems, but that did not help.

After running the toolchain setup that runs SetEnv.cmd and prepends cygwin and python27 to the path my PATH looks like:

C:\wiresharkdev>echo %PATH%
C:\windows\Microsoft.NET\Framework\v4.0.30319;C:\windows\Microsoft.NET\Framework\v3.5;;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools;;c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin;c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\VCPackages;;C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\NETFX 4.0 Tools;C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin;;c:\cygwin\bin;c:\python27;C:\Program Files\Broadcom\Broadcom 802.11;;;C:\Python33\Lib\site-packages\PyQt4;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;;C:\Python33\;C:\Python33\Lib\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\12.0\DLLShared\;C:\Program Files (x86)\Roxio\OEM\AudioCore\;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Hewlett-Packard\HP ProtectTools Security Manager\Bin\;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x64;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Microsoft Windows Performance Toolkit\<br>

I think the python33 in the path could cause problems.

(22 Nov '13, 04:08) Arttu Leinonen

Well, that didn't really help.

With the PATH cleaned down to: C:\windows\Microsoft.NET\Framework\v4.0.30319;C:\windows\Microsoft.NET\Framework\v3.5;;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools;;c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin;c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\VCPackages;;C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\NETFX 4.0 Tools;C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin;;c:\cygwin\bin;c:\python27;C:\Program Files\Broadcom\Broadcom 802.11;C:\windows\system32;C:\windows;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files (x86)\Hewlett-Packard\HP ProtectTools Security Manager\Bin\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Microsoft Windows Performance Toolkit\

It still fails in the same point. Hmmm. I'll see if I'm able to get a virtual machine running to make a clean environment to build in. Otherwise I will move forward with uninstalling cygwin and reinstalling it without any additional components.

(22 Nov '13, 04:21) Arttu Leinonen

So, with a more readable layout:

C:\windows\Microsoft.NET\Framework\v4.0.30319
C:\windows\Microsoft.NET\Framework\v3.5

c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools

c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\VCPackages

C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\NETFX 4.0 Tools
C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin

c:\cygwin\bin
c:\python27
C:\Program Files\Broadcom\Broadcom 802.11

C:\Python33\Lib\site-packages\PyQt4
C:\Program Files (x86)\Intel\iCLS Client\
C:\Program Files\Intel\iCLS Client\

C:\Python33\
C:\Python33\Lib\
C:\windows\system32
C:\windows
C:\windows\System32\Wbem
C:\Program Files\WIDCOMM\Bluetooth Software\
C:\Program Files\WIDCOMM\Bluetooth Software\syswow64
C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\
C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\
C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\
C:\Program Files (x86)\Common Files\Roxio Shared\OEM\12.0\DLLShared\
C:\Program Files (x86)\Roxio\OEM\AudioCore\
C:\windows\System32\WindowsPowerShell\v1.0\
C:\Program Files (x86)\Hewlett-Packard\HP ProtectTools Security Manager\Bin\
C:\windows\System32\WindowsPowerShell\v1.0\
C:\Program Files\Microsoft SQL Server\110\Tools\Binn\
c:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\
C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x86
C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x64
C:\Program Files\Intel\Intel(R) Management Engine Components\DAL
C:\Program Files\Intel\Intel(R) Management Engine Components\IPT
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT
C:\Program Files\Microsoft Windows Performance Toolkit

Note you can use ($env:path).split(";") in Powershell to "pretty-print" the path, I'm sure there is some cygwin awk equivalent.

(22 Nov '13, 04:38) grahamb ♦

Apart from the Python 3 entries, nothing really stands out. We can't use Python 3 in the build yet, so best make sure it's just not present.

My path (XP 32 bit) is pretty identical up until your entry for cygwin, and then all the other paths you have your installed stuff. My build env is XP in a VM that's only used for Wireshark.

My path:

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319 C:\WINDOWS\Microsoft.NET\Framework\v3.5

C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE C:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools

C:\Program Files\Microsoft Visual Studio 10.0\VC\Bin C:\Program Files\Microsoft Visual Studio 10.0\VC\Bin\VCPackages

C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\NETFX 4.0 Tools C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin

C:\WINDOWS\system32 C:\WINDOWS C:\WINDOWS\System32\Wbem C:\WINDOWS\system32\WindowsPowerShell\v1.0 C:\Program Files\CMake 2.8\bin C:\Program Files\TortoiseSVN\bin

FWIW, I would still try to pare your path down first.

(22 Nov '13, 04:47) grahamb ♦
showing 5 of 11 show 6 more comments
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:

×193
×110
×103

question asked: 21 Nov '13, 05:40

question was seen: 3,329 times

last updated: 25 Nov '13, 01:54

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