Setting up/Running Cygwin

Posted by Colin Barnette on Tue 15 Apr 2003 08:44 PM — 36 posts, 122,878 views.

USA #0
I was wondering if you could either help me with running cygwin. I beleive I install it correctly, but, I just don't know how to run it. I can get into bash by just runnning the exe, but, I don't think this is the correct way to do it. I look on the cygwin website, but, I can't find any information for the super newbie.
There is the cygwin.bat that I run out of the main cygwin folder, but I get an error saying it couldn't find /tmp though there is a tmp folder.
Perhaps you could give a intall/running tutorial for cygwin?

Thanks!
USA #1
If you're able to get to a bash prompt, you're well on your way to running a mud on Cygwin.

Start by reading this post:
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=688

If you're going to want to compile using Cygwin, then you'll need to install 'make' and 'gcc' which by my understanding isn't installed by default. Check that psot for more info. After that's done, you should have a working cygwin setup.

Next, check this out:
http://www.gammon.com.au/smaug/howtocompile.htm

The particular section you really want to look at is the "How about an example?" section. Though, being a "super-newbie" as you put it, you may just want to read the whole thing first. Any questions, comments or concerns you know where to go ;-)

I don't think the /tmp error is much of a problem honestly. Though, reinstalling Cygwin may clear it up.
USA #2
Thanks Boborak for your help but, I think it is a little misaligned. I know how to compile. It's just that I'm not sure I set cygwin up correctly. I'm not logging in to bash or anything and I believe I should be doing so. Also, I tried just compiling and I get a bunch of missing header file errors.

Sorry for the length here.
Do you have to have the smaug source in a cygwin folder?


bash-2.05b$ make
make smaug
make.exe[1]: Entering directory `f:/smaug/dist/src'
gcc -c  -O -g3 -Wall -Wuninitialized    -DSMAUG     comm.c
comm.c:58:26: sys/socket.h: No such file or directory (ENOENT)
comm.c:60:32: netinet/in_systm.h: No such file or directory (ENOENT)
comm.c:61:26: netinet/ip.h: No such file or directory (ENOENT)
comm.c:62:25: arpa/inet.h: No such file or directory (ENOENT)
comm.c:63:27: arpa/telnet.h: No such file or directory (ENOENT)
comm.c:64:21: netdb.h: No such file or directory (ENOENT)
comm.c:72: `IAC' undeclared here (not in a function)
comm.c:72: initializer element is not constant
comm.c:72: (near initialization for `echo_off_str[0]')
comm.c:72: `WILL' undeclared here (not in a function)
comm.c:72: initializer element is not constant
comm.c:72: (near initialization for `echo_off_str[1]')
comm.c:72: `TELOPT_ECHO' undeclared here (not in a function)
comm.c:72: initializer element is not constant
comm.c:72: (near initialization for `echo_off_str[2]')
comm.c:73: `IAC' undeclared here (not in a function)
comm.c:73: initializer element is not constant
comm.c:73: (near initialization for `echo_on_str[0]')
comm.c:73: `WONT' undeclared here (not in a function)
comm.c:73: initializer element is not constant
comm.c:73: (near initialization for `echo_on_str[1]')
comm.c:73: `TELOPT_ECHO' undeclared here (not in a function)
comm.c:73: initializer element is not constant
comm.c:73: (near initialization for `echo_on_str[2]')
comm.c:74: `IAC' undeclared here (not in a function)
comm.c:74: initializer element is not constant
comm.c:74: (near initialization for `go_ahead_str[0]')
comm.c:74: `GA' undeclared here (not in a function)
comm.c:74: initializer element is not constant
comm.c:74: (near initialization for `go_ahead_str[1]')
comm.c: In function `init_socket':
comm.c:350: storage size of `sa' isn't known
comm.c:357: warning: implicit declaration of function `socket'
comm.c:357: `AF_INET' undeclared (first use in this function)
comm.c:357: (Each undeclared identifier is reported only once
comm.c:357: for each function it appears in.)
comm.c:357: `SOCK_STREAM' undeclared (first use in this function)
comm.c:363: warning: implicit declaration of function `setsockopt'
comm.c:363: `SOL_SOCKET' undeclared (first use in this function)
comm.c:363: `SO_REUSEADDR' undeclared (first use in this function)
comm.c:392: warning: implicit declaration of function `bind'
comm.c:399: warning: implicit declaration of function `listen'
comm.c:350: warning: unused variable `sa'
comm.c: In function `new_descriptor':
comm.c:792: storage size of `sock' isn't known
comm.c:809: warning: implicit declaration of function `accept'
comm.c:832: `O_NDELAY' undeclared (first use in this function)
comm.c:857: warning: implicit declaration of function `inet_ntoa'
comm.c:857: warning: passing arg 2 of `strcpy' makes pointer from integer withou
t a cast
comm.c:865: warning: implicit declaration of function `gethostbyaddr'
comm.c:866: `AF_INET' undeclared (first use in this function)
comm.c:866: warning: assignment makes pointer from integer without a cast
comm.c:867: dereferencing pointer to incomplete type
comm.c:792: warning: unused variable `sock'
comm.c: In function `read_from_descriptor':
comm.c:1093: warning: implicit declaration of function `recv'
comm.c:1111: `EWOULDBLOCK' undeclared (first use in this function)
comm.c: In function `write_to_descriptor':
comm.c:1414: warning: implicit declaration of function `send'
comm.c: In function `nanny':
comm.c:1663: warning: implicit declaration of function `crypt'
comm.c:1663: warning: passing arg 1 of `strcmp' makes pointer from integer witho
ut a cast
comm.c:1750: warning: assignment makes pointer from integer without a cast
comm.c:1771: warning: passing arg 1 of `strcmp' makes pointer from integer witho
ut a cast
make.exe[1]: *** [comm.o] Error 1
make.exe[1]: Leaving directory `f:/smaug/dist/src'
make.exe: *** [all] Error 2


Thanks for the help.
USA #3
err.. If you're not 'logging in' to bash then how are you compiling? ;-P There is no 'login' to bash, bash is simply a shell, a command interface if you will. If you can start cygwin and you can type 'make' and you get output like you have, then Cygwin should be good to go.

Now for the errors you're getting... I don't use Cygwin (prefer the real stuff) but I believe to use 'make' properly, your 'working directory' (the directory you're in) needs to be in the Cygwin directory structure.

My reccomendation is to take your f:/smaug/ directory and move it to C:\cygwin\home\username\

Where C:\cygwin\ is your cygwin install dir and \username\ is a username of your choice.

That SHOULD clear up the majority of your errors. You also need to edit the Makefile and add -DNOCRYPT. There may be a line with -DNOCRYPT, that is commented out already (in which you uncomment it) or you can just add it alongside the spot that has -DSMAUG. You could also get rid of -Wuninitialized if you wish. It won't affect your compile at all. It's a bit redundant actually.. with -Wall included.
Amended on Wed 16 Apr 2003 11:32 PM by Boborak
USA #4
Still same errors. Here's what I did to try and fix.
F:\cygwin2 is my base dir.
I created home folder and home/colin/.
I put the smaug folder inside of /colin.

The folder hierarchy for the src folder is now:
F:\cygwin2\home\colin\smaug\dist\src\.

Should this work?
USA #5
Ah, also. Where do I put the -DNOCRYPT in the makefile?
USA #6
Ok I have searched the forum and I got rid of all my crypt errors and re_exec things. But now comm.c is giving me the most problems.

This file is still looking for the header files in the wrong places yet it seems like the other files can find them fine. Whats up?

[code]
comm.c:58:26: sys/socket.h: No such file or directory (ENOENT)
comm.c:60:32: netinet/in_systm.h: No such file or directory (ENOENT)
comm.c:61:26: netinet/ip.h: No such file or directory (ENOENT)
comm.c:62:25: arpa/inet.h: No such file or directory (ENOENT)
comm.c:63:27: arpa/telnet.h: No such file or directory (ENOENT)
comm.c:64:21: netdb.h: No such file or directory (ENOENT)
comm.c:72: `IAC' undeclared here (not in a function)
comm.c:72: initializer element is not constant
comm.c:72: (near initialization for `echo_off_str[0]')
comm.c:72: `WILL' undeclared here (not in a function)
comm.c:72: initializer element is not constant
comm.c:72: (near initialization for `echo_off_str[1]')
comm.c:72: `TELOPT_ECHO' undeclared here (not in a function)
comm.c:72: initializer element is not constant
comm.c:72: (near initialization for `echo_off_str[2]')
comm.c:73: `IAC' undeclared here (not in a function)
comm.c:73: initializer element is not constant
comm.c:73: (near initialization for `echo_on_str[0]')
comm.c:73: `WONT' undeclared here (not in a function)
comm.c:73: initializer element is not constant
comm.c:73: (near initialization for `echo_on_str[1]')
comm.c:73: `TELOPT_ECHO' undeclared here (not in a function)
comm.c:73: initializer element is not constant
comm.c:73: (near initialization for `echo_on_str[2]')
comm.c:74: `IAC' undeclared here (not in a function)
comm.c:74: initializer element is not constant
comm.c:74: (near initialization for `go_ahead_str[0]')
comm.c:74: `GA' undeclared here (not in a function)
comm.c:74: initializer element is not constant
comm.c:74: (near initialization for `go_ahead_str[1]')
comm.c: In function `init_socket':
comm.c:350: storage size of `sa' isn't known
comm.c:357: warning: implicit declaration of function `socket'
comm.c:357: `AF_INET' undeclared (first use in this function)
comm.c:357: (Each undeclared identifier is reported only once
comm.c:357: for each function it appears in.)
comm.c:357: `SOCK_STREAM' undeclared (first use in this function)
comm.c:363: warning: implicit declaration of function `setsockopt'
comm.c:363: `SOL_SOCKET' undeclared (first use in this function)
comm.c:363: `SO_REUSEADDR' undeclared (first use in this function)
comm.c:392: warning: implicit declaration of function `bind'
comm.c:399: warning: implicit declaration of function `listen'
comm.c:350: warning: unused variable `sa'
comm.c: In function `new_descriptor':
comm.c:792: storage size of `sock' isn't known
comm.c:809: warning: implicit declaration of function `accept'
comm.c:832: `O_NDELAY' undeclared (first use in this function)
comm.c:857: warning: implicit declaration of function `inet_ntoa'
comm.c:857: warning: passing arg 2 of `strcpy' makes pointer from integer withou
t a cast
comm.c:865: warning: implicit declaration of function `gethostbyaddr'
comm.c:866: `AF_INET' undeclared (first use in this function)
comm.c:866: warning: assignment makes pointer from integer without a cast
comm.c:867: dereferencing pointer to incomplete type
comm.c:792: warning: unused variable `sock'
comm.c: In function `read_from_descriptor':
comm.c:1093: warning: implicit declaration of function `recv'
comm.c:1111: `EWOULDBLOCK' undeclared (first use in this function)
comm.c: In function `write_to_descriptor':
comm.c:1414: warning: implicit declaration of function `send'
comm.c: In function `nanny':
comm.c:1663: warning: implicit declaration of function `crypt'
comm.c:1663: warning: passing arg 1 of `strcmp' makes pointer from integer witho
ut a cast
comm.c:1750: warning: assignment makes pointer from integer without a cast
comm.c:1771: warning: passing arg 1 of `strcmp' makes pointer from integer witho
ut a cast
make.exe[1]: *** [comm.o] Error 1
make.exe[1]: Leaving directory `f:/Cygwin2/home/colin/dist/src'
make.exe: *** [all] Error 2

:\
USA #7
Hmm. The errors you're getting are from gcc not being able to find system includes. Take a look in cygwin\usr\include\ and see if you have a folder named \arpa\
USA #8
Hrm ok, I added a #define WIN32 and that removed all the headerfile problems. I still get a bunch of warnings but, this is the only error:

comm.c:255: parse error before "wsadata"

Here's the code in the file where wsadata is found only, but, I can't find the parse error. =\


#ifdef WIN32
    {
	/* Initialise Windows sockets library */

	unsigned short wVersionRequested = MAKEWORD(1, 1);
	WSADATA wsadata;
	int err;

	/* Need to include library: wsock32.lib for Windows Sockets */
	err = WSAStartup(wVersionRequested, &wsadata);
	if (err)
	{
	    fprintf(stderr, "Error %i on WSAStartup\n", err);
	    exit(1);
	}

	/* standard termination signals */
	signal(SIGINT, (void *) bailout);
	signal(SIGTERM, (void *) bailout);
  }
#endif /* WIN32 */
USA #9
Hmm. The problem with setting #define WIN32 is that you're compiling stuff meant for a Windows native environment into a Unix type of environment. Cygwin is a Unix type of environment and you're asking for trouble by compiling with that configuration.

The WSDATA stuff is WinSock related and I try my best to stay away from it ;-P I don't see anything wrong with that bit of code right off hand. But I also don't know what type of data WSDATA is suppose to be or what MAKEWORD is.
USA #10
Do you know how I can include a library into my compile though?
USA #11
Sure. But a library isn't going to fix your syntax error.

Add '-lwsock32' to your library variable. Look for something called $L_FLAGS= or $LIBS= or $LIBINCLUDES=
USA #12
What file do I add that in? comm.c or the makefile?
USA #13
Heh. Makefile

Anyway.. goodluck. I need sleep.
Australia Forum Administrator #14
I think you are mixing systems here. The WIN32 stuff with the WSA prefix is for the Windows Socket Architecture, however it is not needed for Cygwin. You would use it with MS Visual C++.

If putting that in made most of the errors go away it seems you are on the right track. One thing to do would be to take a closer look at what the #if's are doing near the start. What might work would be to #define unix, for instance.
USA #15
Grab the 1.4aMXP download off of this site. This should do you fine:

ftp.gammon.com.au/smaug/smaug1.4a_mxp.tgz

By all means, it should compile "out of the box". ;-)
USA #16
Thanks. Trying it now. Whats the MXP deal?
USA #17
Urgh. I got these errors. They look very familiar. What should I do!?


gcc -c  -O -g3 -Wall -Wuninitialized    -DSMAUG     comm.c
comm.c:60:26: sys/socket.h: No such file or directory (ENOENT)
comm.c:62:32: netinet/in_systm.h: No such file or directory (ENOENT)
comm.c:63:26: netinet/ip.h: No such file or directory (ENOENT)
comm.c:64:25: arpa/inet.h: No such file or directory (ENOENT)
comm.c:65:27: arpa/telnet.h: No such file or directory (ENOENT)
comm.c:66:21: netdb.h: No such file or directory (ENOENT)
comm.c:76: `IAC' undeclared here (not in a function)
comm.c:76: initializer element is not constant
comm.c:76: (near initialization for `echo_off_str[0]')
comm.c:76: `WILL' undeclared here (not in a function)
comm.c:76: initializer element is not constant
comm.c:76: (near initialization for `echo_off_str[1]')
comm.c:76: `TELOPT_ECHO' undeclared here (not in a function)
comm.c:76: initializer element is not constant
comm.c:76: (near initialization for `echo_off_str[2]')
comm.c:77: `IAC' undeclared here (not in a function)
comm.c:77: initializer element is not constant
comm.c:77: (near initialization for `echo_on_str[0]')
comm.c:77: `WONT' undeclared here (not in a function)
comm.c:77: initializer element is not constant
comm.c:77: (near initialization for `echo_on_str[1]')
comm.c:77: `TELOPT_ECHO' undeclared here (not in a function)
comm.c:77: initializer element is not constant
comm.c:77: (near initialization for `echo_on_str[2]')
comm.c:78: `IAC' undeclared here (not in a function)
comm.c:78: initializer element is not constant
comm.c:78: (near initialization for `go_ahead_str[0]')
comm.c:78: `GA' undeclared here (not in a function)
comm.c:78: initializer element is not constant
comm.c:78: (near initialization for `go_ahead_str[1]')
comm.c:79: `IAC' undeclared here (not in a function)
comm.c:79: initializer element is not constant
comm.c:79: (near initialization for `will_mxp_str[0]')
comm.c:79: `WILL' undeclared here (not in a function)
comm.c:79: initializer element is not constant
comm.c:79: (near initialization for `will_mxp_str[1]')
comm.c:80: `IAC' undeclared here (not in a function)
comm.c:80: initializer element is not constant
comm.c:80: (near initialization for `start_mxp_str[0]')
comm.c:80: `SB' undeclared here (not in a function)
comm.c:80: initializer element is not constant
comm.c:80: (near initialization for `start_mxp_str[1]')
comm.c:80: `IAC' undeclared here (not in a function)
comm.c:80: initializer element is not constant
comm.c:80: (near initialization for `start_mxp_str[3]')
comm.c:80: `SE' undeclared here (not in a function)
comm.c:80: initializer element is not constant
comm.c:80: (near initialization for `start_mxp_str[4]')
comm.c:81: `IAC' undeclared here (not in a function)
comm.c:81: initializer element is not constant
comm.c:81: (near initialization for `do_mxp_str[0]')
comm.c:81: `DO' undeclared here (not in a function)
comm.c:81: initializer element is not constant
comm.c:81: (near initialization for `do_mxp_str[1]')
comm.c:82: `IAC' undeclared here (not in a function)
comm.c:82: initializer element is not constant
comm.c:82: (near initialization for `dont_mxp_str[0]')
comm.c:82: `DONT' undeclared here (not in a function)
comm.c:82: initializer element is not constant
comm.c:82: (near initialization for `dont_mxp_str[1]')
comm.c: In function `init_socket':
comm.c:422: storage size of `sa' isn't known
comm.c:429: warning: implicit declaration of function `socket'
comm.c:429: `AF_INET' undeclared (first use in this function)
comm.c:429: (Each undeclared identifier is reported only once
comm.c:429: for each function it appears in.)
comm.c:429: `SOCK_STREAM' undeclared (first use in this function)
comm.c:435: warning: implicit declaration of function `setsockopt'
comm.c:435: `SOL_SOCKET' undeclared (first use in this function)
comm.c:435: `SO_REUSEADDR' undeclared (first use in this function)
comm.c:464: warning: implicit declaration of function `bind'
comm.c:471: warning: implicit declaration of function `listen'
comm.c:422: warning: unused variable `sa'
comm.c: In function `new_descriptor':
comm.c:866: storage size of `sock' isn't known
comm.c:883: warning: implicit declaration of function `accept'
comm.c:906: `O_NDELAY' undeclared (first use in this function)
comm.c:932: warning: implicit declaration of function `inet_ntoa'
comm.c:932: warning: passing arg 2 of `strcpy' makes pointer from integer withou
t a cast
comm.c:940: warning: implicit declaration of function `gethostbyaddr'
comm.c:941: `AF_INET' undeclared (first use in this function)
comm.c:941: warning: assignment makes pointer from integer without a cast
comm.c:942: dereferencing pointer to incomplete type
comm.c:866: warning: unused variable `sock'
comm.c: In function `read_from_descriptor':
comm.c:1168: warning: implicit declaration of function `recv'
comm.c:1186: `EWOULDBLOCK' undeclared (first use in this function)
comm.c: In function `read_from_buffer':
comm.c:1222: `IAC' undeclared (first use in this function)
comm.c: In function `write_to_descriptor':
comm.c:1691: warning: implicit declaration of function `send'
make.exe[1]: *** [comm.o] Error 1
make.exe[1]: Leaving directory `f:/Cygwin2/home/colin/smaug/dist/src'
make.exe: *** [all] Error 2
USA #18
Ok I added the #define WIN32 thing and also, I changed Makefile to Makefile.unix and makefile.cygwin to just makefile.
I remade and now my first error is:
mud.h:5442: parse error before "HANDLE"

I checked the code and here is the block of code:

typedef struct  
{
    HANDLE		hDirectory;
    WIN32_FIND_DATA	Win32FindData;
    struct dirent	dirinfo;
    char		sDirName[MAX_PATH];
} DIR;


Why isn't there a name for the struct?

and here are the full of the mud.h errors here:
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG comm.c
In file included from comm.c:28:
mud.h:28:23: winsock.h: No such file or directory (ENOENT)
In file included from comm.c:28:
mud.h:30: warning: ignoring #pragma warning
mud.h:5430: conflicting types for `gettimeofday'
c:/djgpp/include/time.h:86: previous declaration of `gettimeofday'
mud.h:5438: warning: useless keyword or type name in empty declaration
mud.h:5442: parse error before "HANDLE"
mud.h:5442: warning: no semicolon at end of struct or union
mud.h:5443: warning: type defaults to `int' in declaration of `Win32FindData'
mud.h:5443: warning: data definition has no type or storage class
mud.h:5445: `MAX_PATH' undeclared here (not in a function)
mud.h:5446: parse error before '}' token
mud.h:5446: warning: type defaults to `int' in declaration of `DIR'
mud.h:5446: warning: data definition has no type or storage class
mud.h:5449: parse error before '*' token
mud.h:5449: warning: type defaults to `int' in declaration of `opendir'
mud.h:5449: warning: data definition has no type or storage class
mud.h:5450: parse error before '*' token
mud.h:5451: parse error before '*' token
USA #19
Ack! Backup. Remove the #define WIN32. You have bigger issues at hand. now that I know what source distro you have and can look at your code, I can tell you that you're missing some important files or that a configuration is muckered up.

The problem is the same that you had before (hence the similar errors). You seem to be missing a directory of system includes. Did you ever check to see if you had the directory:

cygwin/usr/include/arpa/ ?

I'm not sure which Cygwin package would install that, but you may want to try re-installing gcc. Those are fairly standard includes that shouldn't be missing. I'll probably install Cygwin tonight to see if I can't get a better insight on the way the beast works.
USA #20
I have the arpa folder with ftp, telnet and inet header files.
USA #21
Well, perhaps you were right in the begining. It appears your cygwin install didn't go as planned. I just installed the default Cygwin setup with only the additional gcc and make packages. Then I copied that same smaug file you have to a directory in that dir (C:\data\cygwin\home\smaug\ to be exact) and it compiled first try, with only some minor warnings.

*shrug*

I'd try running the setup program again and reininstalling make and gcc, then I'd try a complete Cygwin re-install.
USA #22
*cries*
I download Cygwin again and re-installed getting just about every package on there that I thought I needed. I get the same missing header files in comm.c as I did before. I have them. I don't know what to do.
Can anyone help me!

(Oh yeah)
My directory hierarchy is now:
F:\cyg\usr\smaug\dist\src
Amended on Fri 18 Apr 2003 01:14 AM by Colin Barnette
USA #23
Hmm. These are the only packages I added to the default install:

gcc
gcc-mingw
make
mingw-runtime

That's it. If you want to do a "TEST", you can try to move the missing files to your working dir, and that should by all means work. But I emphasize TEST because you don't want to keep it that way. You need to figure out this problem, as to why gcc isn't finding those files. Anyway to do this test, move the missing files to your src dir and change all of their refrences in comm.c to #include "file.h"

example:
#include "socket.h"
#include "in.h"
#include "in_systm.h"
#include "ip.h"
#include "inet.h"
#include "telnet.h"

What's this gonna prove? Not a heck of alot, but it should compile none the less. *shrug*

-Bobo
USA #24
That didn't work. I get so many errors that I can't paste them all because it fills up the buffer on my command prompt.

Any other ideas?
USA #25
Also, In a reply to what nick said a few posts eariler:
Quote:

I think you are mixing systems here. The WIN32 stuff with the WSA prefix is for the Windows Socket Architecture, however it is not needed for Cygwin. You would use it with MS Visual C++.

If putting that in made most of the errors go away it seems you are on the right track. One thing to do would be to take a closer look at what the #if's are doing near the start. What might work would be to #define unix, for instance.

To get rid of most of my initial errors I had to define WIN32. I can't define both Unix and WIN32 can I?
USA #26
EH!? What do you mean that didn't work?! What the devil are you doing to that poor machine! Trust me, if you moved those files to your src dir then changed their includes to read "file.h" I guarantee gcc would find them if something wasn't REALLY screwy with your machine. At the very least you would get the exact same errors because it wouldn't be able to find the files.
USA #27
Just tested it. Worked perfectly. Here's a chunk of my comm.c


#ifdef WIN32
  #include <io.h>
  #undef EINTR
  #undef EMFILE
  #define EINTR WSAEINTR
  #define EMFILE WSAEMFILE
  #define EWOULDBLOCK WSAEWOULDBLOCK
  #define MAXHOSTNAMELEN 32

  #define  TELOPT_ECHO        '\x01'
  #define  GA                 '\xF9'
  #define  SE                 '\xF0'
  #define  SB                 '\xFA'
  #define  WILL               '\xFB'
  #define  WONT               '\xFC'
  #define  DO                 '\xFD'
  #define  DONT               '\xFE'
  #define  IAC                '\xFF'
  void bailout(void);
  void shutdown_checkpoint (void);
#else
  #include "socket.h"
  #include "in.h"
  #include "in_systm.h"
  #include "ip.h"
  #include "inet.h"
  #include "telnet.h"
  #include "netdb.h"
  #define closesocket close
#endif

#define  TELOPT_MXP        '\x5B'
USA #28
:-| You really, really, really shouldn't have WIN32 defined. That's likely why you got that load of errors. Because Cygwin could finally find the files it was looking for but now it have Unix and Windows arch stuff bashing heads. You're trying to associate 'less errors' with being a good thing. In this case your primary concern should be why gcc isn't finding those files and nothing more. I'm telling you leave the #define WIN32 out.
USA #29
*kicks his computer*
Ok I moved the correct files to my src folder and edited comm.c to correspind to their new location.

I get about... 200-300 warnings and what I guess are errors. All sortsa problems with the headerfiles it is trtying to reference.
*sigh*
USA #30
what are some of the warnings you're getting? I'm doing my best to try and replicate your problem, but I can't seem to break the thing ;-P Have you made any other modifications to the source or the Makefile?
USA #31
comm.c:78: parameter `go_ahead_str' is initialized
comm.c:78: warning: initialization makes pointer from integer without a cast
----------- MORE WARNINGS ----------
comm.c:80: warning: excess elements in scalar initializer
comm.c:80: warning: (near initialization for `start_mxp_str')
comm.c:80: warning: excess elements in scalar initializer
comm.c:80: warning: (near initialization for `start_mxp_str')
comm.c:80: warning: excess elements in scalar initializer
comm.c:80: warning: (near initialization for `start_mxp_str')
comm.c:81: parameter `do_mxp_str' is initialized
comm.c:81: warning: initialization makes pointer from integer without a cast
comm.c:168: declaration for parameter `main' but no such parameter
comm.c:161: declaration for parameter `port' but no such parameter
comm.c:159: declaration for parameter `tax_player' but no such parameter
comm.c:157: declaration for parameter `mail_count' but no such parameter
comm.c:116: declaration for parameter `control' but no such parameter
comm.c:115: declaration for parameter `current_time' but no such parameter
comm.c:114: declaration for parameter `lastplayercmd' but no such parameter
comm.c:113: declaration for parameter `str_boot_time' but no such parameter
comm.c:112: declaration for parameter `new_boot_struct' but no such parameter
comm.c:111: declaration for parameter `new_boot_time' but no such parameter
comm.c:110: declaration for parameter `set_boot_time' but no such parameter
comm.c:109: declaration for parameter `set_boot_time_struct' but no such paramet
er
comm.c:108: declaration for parameter `boot_time' but no such parameter
comm.c:107: declaration for parameter `wizlock' but no such parameter
comm.c:106: declaration for parameter `service_shut_down' but no such parameter
comm.c:105: declaration for parameter `mud_down' but no such parameter

==== LOTS MORE DECLARATION ERRORS ===
netdb.h:160: declaration for parameter `setrpcent' but no such parameter
netdb.h:155: declaration for parameter `herror' but no such parameter
netdb.h:154: declaration for parameter `hstrerror' but no such parameter
netdb.h:153: declaration for parameter `getrpcbynumber' but no such parameter
netdb.h:152: declaration for parameter `getrpcbyname' but no such parameter
netdb.h:151: declaration for parameter `getrpcent' but no such parameter
--- lots more of this ---
netdb.h:137: declaration for parameter `endservent' but no such parameter
netdb.h:136: declaration for parameter `endprotoent' but no such parameter
netdb.h:135: declaration for parameter `endnetent' but no such parameter
netdb.h:134: declaration for parameter `endhostent' but no such parameter
netdb.h:122: declaration for parameter `h_errno' but no such parameter
---- LOTS MORE UNDECLARED ----comm.c:581: `exc_set' undeclared (first use in this function)
comm.c:583: `maxdesc' undeclared (first use in this function)
comm.c:584: `newdesc' undeclared (first use in this function)
`stop_idling'
comm.c:726: warning: implicit declaration of function `set_pager_input'
comm.c:731: warning: implicit declaration of function `nanny'
comm.c:773: warning: implicit declaration of function `pager_output'
comm.c: In function `new_descriptor':
comm.c:866: storage size of `sock' isn't known
comm.c:882: `alarm_section' undeclared (first use in this function)
comm.c:906: `O_NDELAY' undeclared (first use in this function)
comm.c:866: warning: unused variable `sock'
comm.c: At top level:
comm.c:1004: warning: type mismatch with previous implicit declaration
comm.c:949: warning: previous implicit declaration of `free_desc'
comm.c:1004: warning: `free_desc' was previously implicitly declared to return `
int'
comm.c: In function `free_desc':
comm.c:1005: warning: implicit declaration of function `kill_auth'
comm.c: In function `close_socket':
comm.c:1131: `d_next' undeclared (first use in this function)
comm.c:1136: `maxdesc' undeclared (first use in this function)
-----
LOTS MORE TYPE MISMATCHES
-----
comm.c:2612: warning: type mismatch with previous implicit declaration
comm.c:726: warning: previous implicit declaration of `set_pager_input'
comm.c:3822: warning: `set_pager_input' was previously implicitly declared to re
turn `int'
comm.c:3830: warning: type mismatch with previous implicit declaration
comm.c:773: warning: previous implicit declaration of `pager_output'
comm.c:3830: warning: `pager_output' was previously implicitly declared to retur
n `int'
ip.h:82: storage size of `ip_src' isn't known
ip.h:82: storage size of `ip_dst' isn't known
make.exe[1]: *** [comm.o] Error 1
make.exe[1]: Leaving directory `f:/cyg/usr/smaug/dist/src'
make.exe: *** [all] Error 2
USA #32
...

:(

...
USA #33
Ok... what program are you using to edit the files with? About half of those errors lead me to believe you were randomly deleteing lines (which I know you weren't doing) but none of the 'UNDECLARED' stuff should be showing up just because you changed a define.
USA #34
I am using a simle text editor.
http://www.textpad.com
Australia Forum Administrator #35
Stop, stop. It sounds like you are thrashing here. It *can* be compiled under Cygwin. You asked why you can't have Win32 and Unix both defined - well, the defines are set up to allow for one operating system OR another. You can't very well be using two operating systems at once.

However, the WIN32 defines are for the Microsoft Visual C++ compiler, not Cygwin. That is why you had the WSA problems. Don't define WIN32.

If you are using Cygwin it is, effectively, Unix.

You should be getting a minimal number of errors compiling under Cygwin, if you use the right makefile. Eg. the makefile designed for Cygwin, if there is one with this distribution.

If you are getting heaps of errors you may have a "line endings" problem. Try running the unix2dos program available at this site, to convert Unix line-endings to DOS ones.

Also, errors like this:

comm.c:81: parameter `do_mxp_str' is initialized

sound like you have do_mxp_str defined twice or some other bizarre thing.