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 ➜ compiling under Cygnus

compiling under Cygnus

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


Pages: 1 2  3  

Posted by Translucent Hate   USA  (48 posts)  Bio
Date Mon 12 Mar 2001 07:37 AM (UTC)
Message
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.
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #1 on Mon 12 Mar 2001 06:17 PM (UTC)

Amended on Tue 20 Nov 2007 04:23 AM (UTC) by Nick Gammon

Message
To compile under Cygnus, you don't need the Win32 port, as the Cygnus compiler effectively emulates the Unix operating system.

I got it to compile and run using the following steps:

Download the source

Get the source from:

ftp://ftpgame.org/pub/mud/diku/merc/smaug/smaug1.4a.tgz




Create directory


mkdir smaug
cd smaug

Unpack source

tar xvzf smaug1.4a.tgz

Change to source directory

cd dist/src

Amend source as follows

In mud.h:

#define NOCRYPT // <--- add this because we don't have crypt

In interp.c:

#define __rtems__ // <--- Add this
#include <time.h> // <--- before this line

In acct_comm.c, right near the end:

int is_profane (char *what)
{
#if 0 // <--- change from #ifndef WIN32 to #if 0
int ret;

ret = re_exec(what);
if (ret==1)
return(1);
#endif
return(0);
}

Compile source

make

If you get an access violation, try just typing 'make' again.

Change to 'area' directory

cd ../area

Run the server

../src/smaug.exe



All done!



- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Translucent Hate   USA  (48 posts)  Bio
Date Reply #2 on Mon 12 Mar 2001 08:44 PM (UTC)
Message
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...

thanks for the info though.
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #3 on Mon 12 Mar 2001 09:00 PM (UTC)
Message
These are pretty minor changes, so I imagine the others will be similar.

If you have problems, say with ROM, then post a message in the ROM part of the forum.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Translucent Hate   USA  (48 posts)  Bio
Date Reply #4 on Mon 12 Mar 2001 09:12 PM (UTC)
Message
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...
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #5 on Mon 12 Mar 2001 09:42 PM (UTC)

Amended on Mon 12 Mar 2001 09:47 PM (UTC) by Nick Gammon

Message
Keeping a log

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: Edit icon - 1K

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".


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Translucent Hate   USA  (48 posts)  Bio
Date Reply #6 on Mon 12 Mar 2001 09:57 PM (UTC)
Message
well my first problem was

#if 0 // <--- change from #ifndef WIN32 to #if 0

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.
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #7 on Mon 12 Mar 2001 10:26 PM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Translucent Hate   USA  (48 posts)  Bio
Date Reply #8 on Mon 12 Mar 2001 10:33 PM (UTC)
Message
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...
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #9 on Mon 12 Mar 2001 11:09 PM (UTC)
Message
This is how the start of your file is:



#include <sys/types.h>
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include "mud.h"
#ifdef USE_IMC
#include "icec-mercbase.h"
#define __rtems__
#endif




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".

Try it like this:



#include <sys/types.h>
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#define __rtems__
#include <time.h>
#include "mud.h"
#ifdef USE_IMC
#include "icec-mercbase.h"
#endif





- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #10 on Tue 13 Mar 2001 12:57 AM (UTC)

Amended on Tue 13 Mar 2001 01:00 AM (UTC) by Nick Gammon

Message
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).

Then:


cd dist/src
make
cd ../area
../src/smaug.exe



- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Translucent Hate   USA  (48 posts)  Bio
Date Reply #11 on Tue 13 Mar 2001 07:57 AM (UTC)
Message
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.
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #12 on Tue 13 Mar 2001 12:36 PM (UTC)

Amended on Tue 13 Mar 2001 12:38 PM (UTC) by Nick Gammon

Message
Yes, I was a bit surprised when I saw from your error message that you didn't seem to have it under

/home/yourname

... but I just assumed you had found a way to do it.

For the record, my directory structure was:


home
|
nick
|
smaug
|
dist
|
src


This was all under the Cygwin directory, so effectively all of the above were under, in my case:


d:\cygwin


So, from Windows' point of view, the source was in:


d:\cygwin\home\nick\smaug\dist\src





- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Bob The Hydra   (19 posts)  Bio
Date Reply #13 on Fri 13 Apr 2001 05:58 PM (UTC)
Message
I'm trying to compile using Cygwin and I followed your steps but I keep getting the following:
make smaug
make[1]: Entering directory `/cygdrive/c/cygwin/home/acgregory/smaug/dist/src'
rm -f smaug
gcc -o smaug act_comm.o act_info.o act_move.o act_obj.o act_wiz.o boards.o build.o clans.o comm.o comments.o const.o db.o deity.o fight.o handler.o hashstr.o ibuild.o ident.o interp.o magic.o makeobjs.o mapout.o misc.o mpxset.o mud_comm.o mud_prog.o player.o polymorph.o requests.o reset.o save.o shops.o skills.o special.o tables.o track.o update.o grub.o stat_obj.o ban.o services.o planes.o imm_host.o colorize.o
act_info.o(.text+0xb212): undefined reference to `crypt'
act_wiz.o(.text+0x12670): undefined reference to `crypt'
build.o(.text+0x67a1): undefined reference to `crypt'
comm.o(.text+0x3b20): undefined reference to `crypt'
comm.o(.text+0x3ddb): undefined reference to `crypt'
comm.o(.text+0x3ebc): more undefined references to `crypt' follow
collect2: ld returned 1 exit status
make[1]: *** [smaug] Error 1
make[1]: Leaving directory `/cygdrive/c/cygwin/home/acgregory/smaug/dist/src'
make: *** [all] Error 2

Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #14 on Fri 13 Apr 2001 09:33 PM (UTC)
Message
Sounds like you didn't have the define for NOCRYPT.

Alternatively, in the Makefile, add the option -DNOCRYPT to the line that does the compile.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


97,058 views.

This is page 1, subject is 3 pages long: 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.