ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] unistd.h

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Wed, 18 Jul 2007 10:41:33 -0700
champhastings@xxxxxxxxxxxxx wrote:

I am getting compile errors when trying to compile the 99.6 source.
Initially says the file can't be found.

You're building on Windows, right?

If so, there's not supposed to be a unistd.h file (except in Cygwin, but I don't know whether we support building Wireshark in Cygwin - it expects UN*X or Windows, not something running on Windows trying its best to look like UN*X). The "uni" in "unistd.h" comes from "UNIX".

If you're compiling on Windows, you're presumably doing development (users not doing development should just download an installer .exe and run that). As such, see the Developer's Guide:

	http://www.wireshark.org/docs/

In particular, see

	http://www.wireshark.org/docs/wsdg_html_chunked/ChSetupWin32.html#id4733893

"2.2.9. Distclean Sources

The released Wireshark sources contain files that are prepared for a UNIX build (e.g. config.h).

You must distclean your sources before building the first time!

If you've closed cmd.exe in the meantime, prepare cmd.exe again

nmake -f Makefile.nmake distclean to cleanup the Wireshark sources"

Some of the files prepared for a UN*X build in the source tarball are the output of Flex (they're included so that you don't have to have Flex to build on UN*X - one way we distribute Wireshark for UN*X is in a source tarball, for platforms where we don't have installable binaries, so the user can at least build the binaries for their platform). Flex, on UN*X, generates code to build on UN*X, and that code includes "unistd.h". You will have to rebuild that file with Flex on Windows to get a version that will compile on Windows.


If you're not building on Windows, you're presumably building on some amazingly ancient UN*X (which we don't support), or you're building on a UN*X system that doesn't have all the headers installed.