Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ Compiling the server ➜ Setting up/Running Cygwin

Setting up/Running Cygwin

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1  2 3  

Posted by Boborak   USA  (228 posts)  Bio
Date Reply #15 on Thu 17 Apr 2003 09:20 PM (UTC)
Message
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". ;-)
Top

Posted by Colin Barnette   USA  (49 posts)  Bio
Date Reply #16 on Thu 17 Apr 2003 09:33 PM (UTC)
Message
Thanks. Trying it now. Whats the MXP deal?
Top

Posted by Colin Barnette   USA  (49 posts)  Bio
Date Reply #17 on Thu 17 Apr 2003 09:39 PM (UTC)
Message
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
Top

Posted by Colin Barnette   USA  (49 posts)  Bio
Date Reply #18 on Thu 17 Apr 2003 09:55 PM (UTC)
Message
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
Top

Posted by Boborak   USA  (228 posts)  Bio
Date Reply #19 on Thu 17 Apr 2003 10:20 PM (UTC)
Message
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.
Top

Posted by Colin Barnette   USA  (49 posts)  Bio
Date Reply #20 on Thu 17 Apr 2003 10:30 PM (UTC)
Message
I have the arpa folder with ftp, telnet and inet header files.
Top

Posted by Boborak   USA  (228 posts)  Bio
Date Reply #21 on Thu 17 Apr 2003 10:43 PM (UTC)
Message
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.
Top

Posted by Colin Barnette   USA  (49 posts)  Bio
Date Reply #22 on Fri 18 Apr 2003 01:13 AM (UTC)

Amended on Fri 18 Apr 2003 01:14 AM (UTC) by Colin Barnette

Message
*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
Top

Posted by Boborak   USA  (228 posts)  Bio
Date Reply #23 on Fri 18 Apr 2003 02:30 AM (UTC)
Message
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
Top

Posted by Colin Barnette   USA  (49 posts)  Bio
Date Reply #24 on Fri 18 Apr 2003 02:43 AM (UTC)
Message
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?
Top

Posted by Colin Barnette   USA  (49 posts)  Bio
Date Reply #25 on Fri 18 Apr 2003 02:50 AM (UTC)
Message
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?
Top

Posted by Boborak   USA  (228 posts)  Bio
Date Reply #26 on Fri 18 Apr 2003 02:53 AM (UTC)
Message
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.
Top

Posted by Boborak   USA  (228 posts)  Bio
Date Reply #27 on Fri 18 Apr 2003 02:55 AM (UTC)
Message
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'
Top

Posted by Boborak   USA  (228 posts)  Bio
Date Reply #28 on Fri 18 Apr 2003 03:01 AM (UTC)
Message
:-| 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.
Top

Posted by Colin Barnette   USA  (49 posts)  Bio
Date Reply #29 on Fri 18 Apr 2003 03:19 AM (UTC)
Message
*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*
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


105,267 views.

This is page 2, subject is 3 pages long:  [Previous page]  1  2 3  [Next page]

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.