Problem Compiling SWR

Posted by Riley Mccoy on Sun 12 May 2002 03:54 AM — 18 posts, 59,124 views.

Australia #0
Ok so here my third attempt at getting this right.
So i've tried various SWR codes,yet i keep running into the same problem most people have and posted here,but i haven't and won't give up.
I'm using Cygwin,finally figured out how to use it,after forgetting 2 files<G>,got that sorted out.so now i try to compile this file from here swl http://pballgi.com/swl.rar
All goes well until i Make,and i end up getting this error message

$ make
make swreality
make[1]: Entering directory `/home/kristy/swl/swr/dist/src'
rm -f swreality
gcc -o swreality 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 fight.o handler.o hashstr.o id.o
interp.o magic.o makeobjs.o misc.o mud_comm.o mud_prog.o player.o requests.o res
et.o save.o shops.o skills.o special.o tables.o track.o update.o space.o bounty.
o swskills.o -lm -lcrypt
/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/../../../../i686-pc-cygwin/bin/ld: cann
ot find -lcrypt
collect2: ld returned 1 exit status
make[1]: *** [swreality] Error 1
make[1]: Leaving directory `/home/kristy/swl/swr/dist/src'
make: *** [all] Error 2

All i want is SWR to work,thats all,i like the whole idea of SMAUG,and the combination of SWR.
I'd be happy if i can get a working version of any SWR. I've been up the last oh 12 hours trying to get it to work,i got SWR1.0 to work then it crashed,afew times,i couldn't add areas,change skills,without it having a hissy fit.And i aint going to bed until i get it fixed and running and running.Any help would be greatful! And i'll be buying AreaEditor and Mushclient,both excellent.
Keep up the Good work! Long live the Aussies <G>
Australia Forum Administrator #1
It's a rather big download, as he seems, bizarrely, to have left in all the .o files from his compilation. That just makes the download bigger for no real gain.

Anyway, do this ...

  1. Edit 'makefile' and change the NOCRYPT line to read:


    NOCRYPT = -DNOCRYPT


    Also change the line:


    chmod g+w swreality


    to


    chmod g+w swreality.exe

  2. Edit the file 'fight.c' and comment out the include for dir.h, like this:


    // #include <sys/dir.h>

  3. Edit the file 'save.c' and change the line:


    #include <sys/dir.h>


    to


    #include <dirent.h>


    Also change line 2143 from:


    struct direct *de;


    to


    struct dirent *de;


    (Change the "c" to a "n").
  4. Type "make clean" to get rid of the old .o files.
  5. Type "make".


It should then compile and link OK.
Australia Forum Administrator #2
There seem to be a whole lot of warnings about SPELL_ACTION being redefined. Just as well, as the original definition in mud.h looks strangely incomplete ...


#define SPELL_ACTION(skill)   ( ((skill)->fla           \
{                       \
    if ( (ch)->substate == SUB_RESTRICTED )        \
    {                      \
   send_to_char( "You cannot use this command from within another command.\n\r",
 ch ); \
   return;                    \
    }                      \
} while(0)


You could probably delete those lines, they don't seem to achieve much, other than generate warnings.
Australia #3
Well that didn't work at all.....and i followed to the T and it still didn't work. Man i must be doing something wrong. Everything goes alright,until the end,the Bang!
Ayhow heres the error message,once again

gcc -o swreality 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 fight.o handler.o hashstr.o id.o
interp.o magic.o makeobjs.o misc.o mud_comm.o mud_prog.o player.o requests.o res
et.o save.o shops.o skills.o special.o tables.o track.o update.o space.o bounty.
o swskills.o -lm -lcrypt
/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/../../../../i686-pc-cygwin/bin/ld: cann
ot find -lcrypt
collect2: ld returned 1 exit status
make[1]: *** [swreality] Error 1
make[1]: Leaving directory `/home/kristy/swl/swr/dist/src'
make: *** [all] Error 2

man i can't figure it out
Thanks for your help,and no i havent given up
Riley
Australia Forum Administrator #4
In makefile, change the line:


rm -f swreality


to


rm -f swreality.exe


And (more importantly) change:


$(CC) $(L_FLAGS) -o swreality $(O_FILES) -lm -lcrypt


to


$(CC) $(L_FLAGS) -o swreality $(O_FILES) -lm


In other words, get rid of the reference to library "crypt", which you obviously don't have. :)

If you do that, it should link OK. ;)
Australia #5
ok i tried compiling SWRIP, seeing what was wrong with that,all went well till this error

gcc -c -g3 -Wall -DNOCRYPT -DREQUESTS mud_comm.c
gcc -c -g3 -Wall -DNOCRYPT -DREQUESTS mud_prog.c
gcc -c -g3 -Wall -DNOCRYPT -DREQUESTS newarena.c
gcc -c -g3 -Wall -DNOCRYPT -DREQUESTS player.c
gcc -c -g3 -Wall -DNOCRYPT -DREQUESTS requests.c
gcc -c -g3 -Wall -DNOCRYPT -DREQUESTS reset.c
gcc -c -g3 -Wall -DNOCRYPT -DREQUESTS save.c
save.c: In function `load_char_obj':
save.c:966: warning: suggest explicit braces to avoid ambiguous `else'
save.c: In function `load_corpses':
save.c:2145: warning: assignment from incompatible pointer type
save.c:2147: dereferencing pointer to incomplete type
save.c:2149: dereferencing pointer to incomplete type
make[1]: *** [save.o] Error 1
make[1]: Leaving directory `/home/kristy/swrip/src'
make: *** [all] Error 2

And i honestly thought it was gonna work that time,am i asking for too much to have a SWR that i can actually compile? or am i a Star Wars Nut? Anyhow i still havent given up.
I will not give up!
Thanks for all your help

Riley
Australia Forum Administrator #6
You should have a file:


/usr/lib/libcrypt.a


If not, that is why you got the link errors. You might want to investigate that. Perhaps you didn't install the crypt component of Cygwin?
Australia #7
Arrrrrggggggghhhhhhhh!

Ok i'm getting really close to tossing my PC out the Window,that or placing a sign up..Will pay good money for SWRIP working on my PC.Either SWRIP or SWL,both are what i'm after. So now i'm getting this error message.

$ make
make swrip
make[1]: Entering directory `/home/kristy/swrip/src'
gcc -c -g3 -Wall -DREQUESTS act_comm.c
gcc: installation problem, cannot exec `cpp0': No such file or directory
make[1]: *** [act_comm.o] Error 1
make[1]: Leaving directory `/home/kristy/swrip/src'
make: *** [all] Error 2

I'm going bonkers here, and yes its 28 hours straight,all so i can get this working....Please Please Help, i didnt have that last file,got it now..it compiled it it,then went nuts,started it up,went thru the whole thing,then bang,gone again.
Thanks for the patience Nick

Riley
Amended on Sun 12 May 2002 08:51 AM by Riley Mccoy
Australia Forum Administrator #8
Hang on Riley, you have now changed the ground here.

My earlier suggestion, for SWL, should have worked. You had a clean compile, and the only problem was linking against a library (crypt) that you didn't have.

By changing the makefile, you didn't need that library, so all you have to do is go back to SWL, change the makefile to remove the -lcrypt reference, and it should work OK.

Whatever you did recently, to give the cpp0 error, has now corrupted your Cygwin install.

If you can't get it to work any other way, I suggest ...

1. Remove Cygwin
2. Reinstall, including compilers etc.
3. Redo the steps for SWL as described below

Oh yes, and ...

0. Get some sleep first. :)
Australia #9
Yaaaaaaaaa! Throws a huge party! Thanks so much for all your help Nick! it worked.
As you can see here

rm -f swreality.exe
gcc -o swreality 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 fight.o handler.o hashstr.o id.o
interp.o magic.o makeobjs.o misc.o mud_comm.o mud_prog.o player.o requests.o res
et.o save.o shops.o skills.o special.o tables.o track.o update.o space.o bounty.
o swskills.o -lm
chmod g+w swreality.exe
chmod g+w 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 fight.o handler.o hashstr.o id.o interp.o
magic.o makeobjs.o misc.o mud_comm.o mud_prog.o player.o requests.o reset.o sav
e.o shops.o skills.o special.o tables.o track.o update.o space.o bounty.o swskil
ls.o
make[1]: Leaving directory `/home/kristy/swr/dist/src'

Ok now that i finally got it to compile,what do i do now,lile lastime i tried it,it went funny. So how do i run it without it having a hissy fit.The SWReality.exe is in the SRC Dir,where its meant to be,i hope thats where its meant to be. Now what?
And thanks again for all your help nick.

Riley
Australia Forum Administrator #10
Ah yes, what next?

The first thing I would do is change to the area directory, and run it ...


cd ../area
../src/swreality.exe
Australia #11
ok now i've run into this
Resetting: eze.are
Resetting: latty.are
Resetting: mechis3.are
Resetting: krrugr.are
Resetting: mon_cal.are
Resetting: land.vehicles
Resetting: karnt2.are
Resetting: hawkins.are
Resetting: naboo.are
Resetting: ezekiel.are
Mon May 13 14:49:28 2002 :: Initializing socket
Init_socket: bind: errno EADDRNOTAVAIL triggered

So how do i fix that?

Riley
Australia Forum Administrator #12
OK, let's look at a bit of debugging technique ...

The error message suggests that there is problem initialising the socket (ie. TCP/IP) with the error "address not available" (guessing here). It was generated by the routine "bind".


Mon May 13 14:49:28 2002 :: Initializing socket
Init_socket: bind: errno EADDRNOTAVAIL triggered


Search for "bind" to see where that might be ...


$ grep bind *.c
comm.c: if ( bind( fd, (struct sockaddr *) &sa, sizeof(sa) ) == -1 )
comm.c: perror( "Init_socket: bind" );


OK, it's in comm.c. Edit that and look for the word 'bind' ...


inet_aton("216.162.171.220", &sa.sin_addr);
if ( bind( fd, (struct sockaddr *) &sa, sizeof(sa) ) == -1 )


Hmm - one line before "bind" is a reference to a specific IP address - "216.162.171.220". I am deeply suspicious of this line, a hard-coded IP address is hardly going to work for everybody, and is probably why you got "address not available. Comment it out ...


//inet_aton("216.162.171.220", &sa.sin_addr);


Type "make" to rebuild, and try again ...


Resetting: eze.are
Resetting: latty.are
Resetting: mechis3.are
Resetting: krrugr.are
Resetting: mon_cal.are
Resetting: land.vehicles
Resetting: karnt2.are
Resetting: hawkins.are
Resetting: naboo.are
Resetting: ezekiel.are
Mon May 13 16:35:54 2002 :: Initializing socket
Mon May 13 16:35:54 2002 :: Star Wars Reality ready on port 4000.


There you are! Working. :)
Australia #13
Nick you are a Legend,great patience,very helpful,man alot of thanks go out to you!
While i was waiting for a response to my post, i decided to fiddle with SWRIP,kill the time,that or throw my PC out the window,anyhow spent about 10 or 15 mins, typed make,and Bang it starts to compile,next thing i started it up and it working,perfectly!
I will however finish fixing SWL, but for the meantime,i'm taking a break and playing SWRIP,it'll do for the meantime.
28 hours i did straight,nuts comes to mind! Then slept most of the day away<G>
Anyhow keep up the great work Nick,and thanks again!

Riley
Australia #14
Ok,things are working fine,not sure if this is a server or coding error. The game runs well, afew minor things,but this one error is driving me nuts,hopefully you might be able to help,anyhow here it is...

Mon May 13 19:18:01 2002 :: [*****] BUG: Load_ship_file: # not found.
Mon May 13 19:18:01 2002 :: [*****] BUG: Load_ship_file: # not found.
Mon May 13 19:18:01 2002 :: [*****] BUG: Load_ship_file: # not found.
Mon May 13 19:18:01 2002 :: [*****] BUG: Load_ship_file: # not found.
Mon May 13 19:18:01 2002 :: [*****] BUG: Cannot load ship file: coruscant.shuttl
e
Mon May 13 19:18:01 2002 :: [*****] BUG: Load_ship_file: # not found.
Mon May 13 19:18:01 2002 :: Done ships
Mon May 13 19:18:01 2002 :: Loading bounties
Mon May 13 19:18:01 2002 :: Loading disintigrations...
Mon May 13 19:18:01 2002 :: Done bounties
Mon May 13 19:18:01 2002 :: Loading governments
Mon May 13 19:18:01 2002 :: Loading planets...
Mon May 13 19:18:01 2002 :: $
Mon May 13 19:18:01 2002 :: Done planets
Mon May 13 19:18:01 2002 :: Resetting areas
Resetting: limbo.are
Resetting: newacad.are
Resetting: space.are
Mon May 13 19:18:01 2002 :: [*****] BUG: Equip_char: already equipped (16).
Resetting: omni_complex

The part i'm talking about is mainly Load_ship_file errors.
It has me totally stumped. Theres another major error,but forgot to copy it,i'll do that shortly.Basically thats the ship from the Academy to the Space area.
Anyhow thanks

Riley
Amended on Mon 13 May 2002 09:26 AM by Riley Mccoy
Australia #15
This is the other major error i keep on getting

../storeroom/32179: No such file or directory
Mon May 13 19:51:04 2002 :: [*****] BUG: Save_storeroom: fopen
Mon May 13 19:51:04 2002 :: [*****] BUG: ../storeroom/32179
No idea what that is...
Slowly getting frustrated

Riley
Australia Forum Administrator #16
Maybe you have a number where there should be a filename in the clan configuration file.

Search for "Save_storeroom" in the source.
Australia Forum Administrator #17
I don't know much about SWR - it would have to come under the category of "unsupported". Stuff like that is given out for free, but if you can't get it to work you either need to find the original developers, or try to work it out.

I could spend a lot of time on something like that, because I don't really know what it is attempting to do, so I can't tell if it has done it or not.