i'm using the smaug1.4 win32 port that you created,
but i can't seem to compile it under cygnus...
you asked to post it here so i did, i'm not too sure
what is causing the problem, but i'm sure its a
simple change in the code.
i've been checking out other code bases as well...
is it going to be pretty much the same changes
using cygnus or alot different? for example...
rom24b6 i've been looking into and also the
rogue code base... i'm pretty sure those would
have similiar changes but not positive...
i will do that... definately... cause i'm sure
others are doing it this way as well...
here's the deal with the smaug... i downloaded that
gzip from the ftp site, made the changed you specified
and still came up with errors... have you found a
way to log in cygnus cause the only way i can log is
the old print screen deal...
the screen is at
http://www.ultranet.com/~jjmartin/errors/error.jpg
it'll take a bit to come up but thats the error...
wish i could cut and paste the text...
The simple way of keeping a log is to redirect stdout and stderr, like this:
make &> mylog.txt
This will put everything into "mylog.txt".
If you want to watch on the screen as well, use a variant:
make 2>&1 | tee mylog.txt
Copying text from the screen
Another useful trick to know is how to pull text out of a "dos" window. To do this click on the "edit" button:
Then, click and drag with the mouse until the desired text is highlighted. Then press <enter> on the keyboard, and the selected text will be copied to the clipboard.
This error message
Your jpg image gave an error message similar to this:
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG interp.c
interp.c: In function `interpret':
interp.c:758: warning: int format, long int arg (arg 7)
interp.c:758: warning: int format, long int arg (arg 8)
interp.c: In function `update_userec':
interp.c:1192: warning: implicit declaration of function `timerisset'
interp.c:1193: warning: implicit declaration of function `timercmp'
interp.c:1193: parse error before `<'
interp.c: At top level:
interp.c:1198: parse error before `if'
make[1]: *** [interp.o] Error 1
make[1]: Leaving directory `/home/nick/smaug/dist/src'
make: *** [all] Error 2
I got this before I made the change that I recommended to the file interp.c. Did you do that?
#define __rtems__ // <--- Add this
#include <time.h> // <--- before this line
It might not be obvious, but that is two underscores on each side of the word "rtems".
i actually only changed WIN32 to 0 i didn't delete
the ndef, which cleared up most of the errors...
also in interp.c i found the lines that those
errors occurred on and saw the end of the lines
looking like this , <)
and i said "hey.. lets try this for kicks" and removed
the , and the < and it went through all the files no
problem but then got a big long error list... guess
that was bad. ;)
and yeah... i cut and pasted the text, so it know that
i have __rtems__
but when i move that above time.h i get more errors...
maybe there is something else i'm missing that needs a
change because right now it should be working cause i
have changed exactly what you did.
Hmmm - removing lines that give you errors is only a short-term solution. :)
Can you email me your copy of interp.c? I would like to try it myself.
And please include the exact error messages using the technique I described for saving them to a text file. Saying "I got more errors" doesn't help me solve the problem.
well basically the error i get is exactly the same
as the way you posted it in your last message, that
is why i didn't post the error... and on my last message
i thought i added asking you if you wanted to look
at the interp.c that i have... and i actually put
it up on my site.
http://www.ultranet.com/~jjmartin/errors/interp.c
it just seems odd that we are doing the exact same
changes with different results... but then again
its almost 2am here...
My instructions said to put "#define __rtems__" before "#include <time.h>", which you have not done. It is essential that they be in the right order, because the file "time.h" checks to see if __rtems__ is defined, and if so, creates "timercmp" and "timerisset".
I have had a query from someone else (who is not familiar with Unix commands) about how to do the steps I outlined above.
The basic steps I took were:
Create the directory
Using the Unix shell (ie. after running cygwin.bat) create a subdirectory:
mkdir smaug
Change to this directory
cd smaug
Copy the archive into that directory
Exactly how you do this depends on where you downloaded the smaug archive to. Assuming you put it into C:\SMAUG, do this:
cp c:/smaug/smaug1.4a.tgz .
Note the trailing dot.
Unzip the archive
tar xvzf smaug1.4a.tgz
Check the results
By doing a "ls" (list directory) you should see the following:
dist ftp_game.org smaug1.4a.tgz
"Dist" is a directory (it stands for "distribution").
For more detail, do an "ls -l", like this:
$ ls -l
total 772
drwxr-xr-x 20 nick None 4096 May 28 1999 dist
-rw-r--r-- 1 nick None 1106 Oct 16 1997 ftp_game.org
-rw-r--r-- 1 nick None 1575821 Mar 17 2000 smaug1.4a.tgz
Do the other steps
Now you can do the other steps I described above.
I would edit the files and make the suggested changes using any text editor that supports Unix-style text files (eg. UltraEdit).
ok... finally got it running, but this is what is
interesting...
the first time i made the changes i actually put the
__rtems__ before time.h in interp.c but that wasn't
even the problem... the problem was that the mud was
in c:\smaug\dist\src and now its locate in the dir
c:\cygwin\home\laptop\smaug\dist\src and everything
is peachy.. so i guess the problem is that is doesn't
like being in a directory not in cygwin.
thanks for the help... i'm going to post on the rom
board the problem with the rom later on, but i'm more
wanting to check out rogue codebase, but i'm not sure
if you are even familiar with that, but i think i might
just stick with smaug and/or rom cause those are what
i am familiar with.
At the risk of sounding like an airhead...
Where exactly do I put the #Define NOCRYPT in mud.h? I put it in there befroe I ever tried to compile it.
Also -Dnocrypt doesn't seem to work.
if you have the newest version of cygwin(and by that i mean you downloaded the setup.exe) then you have the crypt.h file. all you need to do is add #include <crypt.h> to the top of those files that gave you errors, with the other includes. then in your makefile add -lcrypt to the line that says this, $(CC) $(L_FLAGS) $(USE_IMC) -g -o smaug.exe $(O_FILES) -lcrypt. now you have encrypted passwords.
Attempting to compile smaug1.4a under Win98/CygnusB19 and getting many errors re: files not found (comm.c 60 -> netinit/in_systm.h). I'm assuming that perhaps this should be commented out like regex references?
Is there a full-blown detailed list of what should be modified/deleted for successful compiling? It was by chance I read about the regex references. TIA!
Thanks for the reply Nick. Everything compiles, up to interp.c then I get:
interp.c: In function `update_userec':
interp.c:1192: warning: implicit declaration of function `timerisset'
interp.c:1192: warning: implicit declaration of function `timercmp'
interp.c:1192: parse error before `<'
interp.c: At top level:
interp.c:1197: parse error before `if'
make[1]: *** [interp.o] Error 1
make: *** [all] Error 2
Well, I grabbed the latest Cygnus (setup.exe and installed it). Everything compiled ok (smaug1.4a). After a make clean/make smaug everything came out fine. Thanks to all for the feedback! Now, is it possible to create a smaug.exe that doesn't require the cygwin1.dll? Just curious. Thanks again.
May as well copy and paste the relevant macros into mud.h or the top of the source file that is causing the problems. That should fix it (the brute-force way) ...
/* Convenience macros for operations on timevals.
NOTE: `timercmp' does not work for >= or <=. */
#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
#define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0)
#define timercmp(a, b, CMP) \
(((a)->tv_sec == (b)->tv_sec) ? \
((a)->tv_usec CMP (b)->tv_usec) : \
((a)->tv_sec CMP (b)->tv_sec))
#define timeradd(a, b, result) \
do { \
(result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \
(result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \
if ((result)->tv_usec >= 1000000) \
{ \
++(result)->tv_sec; \
(result)->tv_usec -= 1000000; \
} \
} while (0)
#define timersub(a, b, result) \
do { \
(result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
(result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
if ((result)->tv_usec < 0) { \
--(result)->tv_sec; \
(result)->tv_usec += 1000000; \
} \
} while (0)
Well, I grabbed the latest Cygnus (setup.exe and installed it). Everything compiled ok (smaug1.4a). After a make clean/make smaug everything came out fine. Thanks to all for the feedback! Now, is it possible to create a smaug.exe that doesn't require the cygwin1.dll? Just curious. Thanks again.
Ah yes, well that is the better way of doing it. :)
To work without the cygwin1.dll you need to use a different compiler. The version I did with Microsoft Visual C++ didn't need the DLL, however that is not a free compiler.