Compiling the Updated 1.4a

Posted by Colin Barnette on Tue 08 Apr 2003 07:49 PM — 15 posts, 58,139 views.

USA #0
I am trying to compile the Updated 1.4a code that I got from: http://www.cs.utk.edu/~london/smaug/winsmaug1.4a.zip

I get a whole lot of errors. I am using VS.NET but, I don't think that should be a problem. Any help would be VERY apreciated.

Oh, also, when I try to edit the files, it says it cannot find the files. It says a file is here:
..\dist\src\mud_prog.c
when really, it should just point to the file:
mud_prog.c

So I imported all the files from the correct location and try to compile. Didn't work at all.

Please help!
Australia Forum Administrator #1
A whole lot of errors eh? Can you post at least some of them? It is hard to guess what is wrong.
USA #2
Ok, sorry about the vagueness of the last post. Here's what I get once I fix the location problem:

(Mind you I'm using .NET so..)

c:\Smaug\src\webserver.c(28): fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory
c:\Smaug\src\webclient.c(28): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory
c:\Smaug\src\router.c(2): error C2143: syntax error : missing '{' before '-'
c:\Smaug\src\router.c(2): error C2059: syntax error : '-'
c:\Smaug\src\router.c(6): error C2018: unknown character '0x40'; unicode identifiers are not supported
c:\Smaug\src\router.c(8): error C2061: syntax error : identifier 'can'


--- Lots more syntax errors and then :---

c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\stdio.h(371): error C2059: syntax error : ','
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\stdio.h(371): error C2059: syntax error : ')'
c:\Smaug\src\router.c(30): fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory
c:\Smaug\src\imc.h(27): fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory
c:\Smaug\src\imc-util.c(29): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory
c:\Smaug\src\imc-mercbase.c(38): fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory
c:\Smaug\src\imc.h(27): fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory
c:\Smaug\src\imc-interp.c(26): fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory
c:\Smaug\src\imc-events.c(29): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory
c:\Smaug\src\imc-config.c(29): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory
c:\Smaug\src\imc.c(29): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory
c:\Smaug\src\imc.h(27): fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory
c:\Smaug\src\icec-mercbase.c(29): fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory
c:\Smaug\src\imc.h(27): fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory
c:\Smaug\src\imc.h(27): fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory

Australia Forum Administrator #3
First, it shouldn't be trying to include unistd.h - that is a unix include file. Check the defines, maybe

#define WIN32

That might eliminate some of them.
USA #4
I looked for the #define WIN32 and found this:

#ifdef WIN32
  #include <winsock.h>
  #include <sys/types.h>
  #pragma warning( disable: 4018 4244 4761)
  #define NOCRYPT
  #define index strchr
  #define rindex strrchr
#else
  #include <unistd.h>
#ifndef SYSV
  #include <sys/cdefs.h>
#else
  #include <re_comp.h>
#endif
  #include <sys/time.h>
#endif


I am using XP Pro. Is that why it isnt recognizing that I am win32?

Thanks again.
Australia Forum Administrator #5
That is testing the define. If it isn't set, and I guess it isn't because it is including unistd.h, insert the line:

#define WIN32 1

just before where it is first tested.
USA #6
Still getting same errors, and it is also trying to open unistd.h still. I thought this 1.4a was supposed to have bug fixes in it =p.

Any other ideas?
Australia Forum Administrator #7
I can't believe that this will try to include unistd.h:



#define WIN32 1

#ifdef WIN32
  #include <winsock.h>
  #include <sys/types.h>
  #pragma warning( disable: 4018 4244 4761)
  #define NOCRYPT
  #define index strchr
  #define rindex strrchr
#else
  #include <unistd.h>
#ifndef SYSV
  #include <sys/cdefs.h>
#else
  #include <re_comp.h>
#endif
  #include <sys/time.h>
#endif


Is that exactly how you have it? In that order? With that capitalisation? The #ifdef WIN32 means it certainly should not include unistd.h because that is part of the #else.

Australia Forum Administrator #8
Also check for unistd.h in other include files. You really should have -DWIN32 as part of the makefile, so that it is included for the whole project (or however you do it with this compiler).
Australia Forum Administrator #9
Quote:

I thought this 1.4a was supposed to have bug fixes in it =p.



Yes, but the people who maintain this stuff don't test it on every conceivable compiler. Usually you can get stuff to compile under normal Unix (eg. Linux) or Cygwin with luck. Also, MS Visual C++ tends to have a few followers. Once you start switching to another compiler you are working in an environment where maybe no-one has tried it, or if they have, the changes haven't been migrated back into the source code. Sorry.
USA #10
I think it would take alot of code changes to get SMAUG to compile in VS.NET. Never used it before.

What I would suggest is it getting Cygwin, it's a free download at www.cygwin.com. You will need binutils, gcc and the make packages.

If you have MS Visual C++ there is a ported version of SMAUG to work with it. SmaugWiz. Can get it at www.eticomm.net/~russk2/
USA #11
Thanks for all the help!

What would you all suggest as a good free compiler for the SMAUG code?
Australia Forum Administrator #12
Cygwin, see post above.
USA #13
Doh! Didn't read thoroughly enough!
Thanks for all the help!
USA #14
Should be noted, Colin, that the files you were having trouble with all appeared to be from the IMC2 client code. This is something that's not actually required for the mud to operate fully. It's an intermud chat protocol. If this isn't something you want to use, there should be a way to disable it from being compiled. Look in the Makefile for how to handle that and it should be fairly easy.