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 ➜ Need Help Compiling SWR

Need Help Compiling SWR

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


Pages: 1 2  

Posted by Raistlen   (10 posts)  Bio
Date Wed 18 Jun 2003 10:07 AM (UTC)

Amended on Wed 18 Jun 2003 12:47 PM (UTC) by Raistlen

Message
Hello, I'm new here, I tried searching for other posts about this but haven't found any. If this was covered before, I apologize and could gladly use a pointer in the right direction. :P

Heres the problem, I am trying to compile pure stock SWR code. I had managed to compile and run it fine on cygwin, no problem. The trouble comes when I'm now trying to compile it on a native Linux enviorenment.

The compiler will compile all the files except act_wiz.c, and here is the error dump I recieve.


[16:07](raistlen@linux src)$ make
make swreality
make[1]: Entering directory `/home/raistlen/dist/src'
gcc -c -g3 -Wall    act_wiz.c
act_wiz.c:2355:22: missing terminating " character
act_wiz.c: In function `do_balzhur':
act_wiz.c:2356: error: parse error before "Thoric"
act_wiz.c:2356: error: stray '\' in program
act_wiz.c:2356: error: stray '\' in program
act_wiz.c:2356:11: missing terminating " character
act_wiz.c:2372:25: missing terminating " character
act_wiz.c:2373: error: parse error before "backup"
act_wiz.c:2373: error: `backup' undeclared (first use in this function)
act_wiz.c:2373: error: (Each undeclared identifier is reported only once
act_wiz.c:2373: error: for each function it appears in.)
act_wiz.c:2373: error: stray '\' in program
act_wiz.c:2373: error: stray '\' in program
act_wiz.c:2373: error: parse error before "r"
act_wiz.c:2373:12: missing terminating " character
act_wiz.c:2376:26: missing terminating " character
act_wiz.c:2377: error: stray '\' in program
act_wiz.c:2377: error: stray '\' in program
act_wiz.c:2377:12: missing terminating " character
act_wiz.c: At top level:
act_wiz.c:2385: warning: type defaults to `int' in declaration of `make_wizlist'
act_wiz.c:2385: error: conflicting types for `make_wizlist'
mud.h:4299: error: previous declaration of `make_wizlist'
act_wiz.c:2385: warning: data definition has no type or storage class
act_wiz.c:2386: error: parse error before string constant
act_wiz.c:2386: warning: type defaults to `int' in declaration of `do_help'
act_wiz.c:2386: error: conflicting types for `do_help'
mud.h:3561: error: previous declaration of `do_help'
act_wiz.c:2386: warning: data definition has no type or storage class
act_wiz.c:2387: error: parse error before numeric constant
act_wiz.c:2387: warning: type defaults to `int' in declaration of `set_char_colo
r'
act_wiz.c:2387: error: conflicting types for `set_char_color'
mud.h:4234: error: previous declaration of `set_char_color'
act_wiz.c:2387: warning: data definition has no type or storage class
act_wiz.c:2388: error: parse error before string constant
act_wiz.c:2388: warning: type defaults to `int' in declaration of `send_to_char_
color'
act_wiz.c:2388: error: conflicting types for `send_to_char_color'
mud.h:4231: error: previous declaration of `send_to_char_color'
act_wiz.c:2388: warning: data definition has no type or storage class
make[1]: *** [act_wiz.o] Error 1
make[1]: Leaving directory `/home/raistlen/dist/src'
make: *** [all] Error 2


Any help would be greatly appreciated. =)

P.S

make version: GNU Make 3.80
GCC version: (GCC) 3.3 (Debian)
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #1 on Wed 18 Jun 2003 08:37 PM (UTC)
Message
As helpful as the error messages might be, without the code most of us really cant help much :( Paste in the relevant section of act_wiz and I'd bet its probly an easy fix once we have the code.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Celestine   (29 posts)  Bio
Date Reply #2 on Wed 18 Jun 2003 09:55 PM (UTC)
Message
Not all files compiled correctly either (well...not for sure). You should type 'make -k' without the ' to compile all possible. Either copy/paste the code at fault or give us the source. Then we can help you. :)
Top

Posted by Raistlen   (10 posts)  Bio
Date Reply #3 on Wed 18 Jun 2003 10:02 PM (UTC)
Message
The act_wiz.c im using is pure stock, I never touched it, but here is the relevent code section.

starting from 2349 and ending in 2392.


    sprintf( buf, "%s%s", GOD_DIR, capitalize(victim->name) );  
 
    if ( !remove( buf ) )
      send_to_char( "Player's immortal data destroyed.\n\r", ch );
    else if ( errno != ENOENT )
    {
      ch_printf( ch, "Unknown error #%d - %s (immortal data).  Report to 
Thoric\n\r",
              errno, strerror( errno ) );
      sprintf( buf2, "%s balzhuring %s", ch->name, buf );
      perror( buf2 );
    }
    sprintf( buf2, "%s.are", capitalize(arg) );
    for ( pArea = first_build; pArea; pArea = pArea->next )
      if ( !strcmp( pArea->filename, buf2 ) )
      {
        sprintf( buf, "%s%s", BUILD_DIR, buf2 );
        if ( IS_SET( pArea->status, AREA_LOADED ) )
          fold_area( pArea, buf, FALSE );
        close_area( pArea );
        sprintf( buf2, "%s.bak", buf );
        set_char_color( AT_RED, ch ); /* Log message changes colors */
        if ( !rename( buf, buf2 ) )
          send_to_char( "Player's area data destroyed.  Area saved as 
backup.\n\r", ch);
        else if ( errno != ENOENT )
        {
          ch_printf( ch, "Unknown error #%d - %s (area data).  Report to 
Thoric.\n\r",
                  errno, strerror( errno ) );
          sprintf( buf2, "%s destroying %s", ch->name, buf );
          perror( buf2 );   
        }
      }
 
 
        make_wizlist();
	do_help(victim, "M_BALZHUR_" );
	set_char_color( AT_WHITE, victim );
	send_to_char( "You awake after a long period of time...\n\r", victim );
	while ( victim->first_carrying )
	     extract_obj( victim->first_carrying );
    return;
}
Top

Posted by Celestine   (29 posts)  Bio
Date Reply #4 on Thu 19 Jun 2003 12:08 AM (UTC)
Message
change those lines to:




sprintf( buf, "%s%s", GOD_DIR, capitalize(victim->name) );

if ( !remove( buf ) )
send_to_char( "Player's immortal data destroyed.\n\r", ch );
else if ( errno != ENOENT )
{
ch_printf( ch, "Unknown error #%d - %s (immortal data). Report to Thoric\n\r",
errno, strerror( errno ) );
sprintf( buf2, "%s balzhuring %s", ch->name, buf );
perror( buf2 );
}
sprintf( buf2, "%s.are", capitalize(arg) );
for ( pArea = first_build; pArea; pArea = pArea->next )
if ( !strcmp( pArea->filename, buf2 ) )
{
sprintf( buf, "%s%s", BUILD_DIR, buf2 );
if ( IS_SET( pArea->status, AREA_LOADED ) )
fold_area( pArea, buf, FALSE );
close_area( pArea );
sprintf( buf2, "%s.bak", buf );
set_char_color( AT_RED, ch ); /* Log message changes colors */
if ( !rename( buf, buf2 ) )
send_to_char( "Player's area data destroyed. Area saved as backup.\n\r", ch);
else if ( errno != ENOENT )
{
ch_printf( ch, "Unknown error #%d - %s (area data). Report to Thoric.\n\r",
errno, strerror( errno ) );
sprintf( buf2, "%s destroying %s", ch->name, buf );
perror( buf2 );
}
}


make_wizlist();
do_help(victim, "M_BALZHUR_" );
set_char_color( AT_WHITE, victim );
send_to_char( "You awake after a long period of time...\n\r", victim );
while ( victim->first_carrying )
extract_obj( victim->first_carrying );
return;
}

and see what you get. I deleted a few of the spaces between lines (meaning the thoric line, there was an enter instead of a space there).
Top

Posted by Raistlen   (10 posts)  Bio
Date Reply #5 on Thu 19 Jun 2003 12:17 AM (UTC)
Message
Its working now, thank you so much. =D
Top

Posted by Raistlen   (10 posts)  Bio
Date Reply #6 on Sun 22 Jun 2003 07:45 PM (UTC)

Amended on Sun 22 Jun 2003 07:46 PM (UTC) by Raistlen

Message
Hey again, I'm trying to compile the SWRip, and im getting more errors on pure stock code. The error is


misc.c:3209: error: invalid operands to binary +
misc.c:4081:2: warning: no newline at end of file
make[1]: *** [misc.o] Error 1
make[1]: Leaving directory `/home/raistlen/swrip/src'
make: *** [all] Error 2


And the relevent sections are


int add_bad_name(char *name)
{
  FILE *fp;
  char *ln;
  fpos_t pos;

  if (check_bad_name(name))
    return 0;

  if ((fp = fopen(BAD_NAME_FILE,"r+")) == NULL)
  {
    bug("Error opening Bad Name file.");
    return -1;
  }

  ln = fread_string_nohash(fp);
  while(!is_name("$",ln) && !feof(fp))
      ln = fread_string_nohash(fp);

  /* Delete the $~ from the end of the file */
  fgetpos(fp, &pos);
  pos += -2;
  fsetpos(fp, &pos);
  fprintf(fp,"%s~\n",name);
  fprintf(fp,"$~");
  fclose(fp);
  return 1;
}


With the " pos += -2;" being the line generating the error.

the second error, end file, il just paste the end of the file, i suppose.

Here is how the file ends.


	        ch->nextquest = 30;
	        sprintf(buf, "You have run out of time for your quest!\n\rYou may quest again in %d minutes.\n\r",ch->nextquest);
	        send_to_char(buf, ch);
                REMOVE_BIT(ch->act, PLR_QUESTOR);
                ch->questgiver = NULL;
                ch->countdown = 0;
                ch->questmob = 0;
	    }
	    if (ch->countdown > 0 && ch->countdown < 6)
	    {
	        send_to_char("Better hurry, you're almost out of time for your quest!\n\r",ch);
	        return;
	    }
        }
    }
    return;
}



Any help would be greatly appreciated, as always. =)
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #7 on Sun 22 Jun 2003 08:44 PM (UTC)
Message
Hrm, first one is just wierd, try changing the offending like to pos++ -2. As for the 2nd, at the end of the file just hit enter to put a newline at the end of the file.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Raistlen   (10 posts)  Bio
Date Reply #8 on Sun 22 Jun 2003 08:53 PM (UTC)
Message
That change yields:


misc.c: In function `add_bad_name':
misc.c:3209: error: wrong type argument to increment
make[1]: *** [misc.o] Error 1
make[1]: Leaving directory `/home/raistlen/swrip/src'
make: *** [all] Error 2
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #9 on Sun 22 Jun 2003 09:06 PM (UTC)
Message
K, try changing from pos += -2 to pos -= 2 and lemme know what happens

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Raistlen   (10 posts)  Bio
Date Reply #10 on Sun 22 Jun 2003 09:11 PM (UTC)
Message
That gives:


misc.c: In function `add_bad_name':
misc.c:3209: error: invalid operands to binary -
make[1]: *** [misc.o] Error 1
make[1]: Leaving directory `/home/raistlen/swrip/src'
make: *** [all] Error 2
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #11 on Sun 22 Jun 2003 09:13 PM (UTC)
Message
Hrm... what are the includes for that file while Im thinking about it, that error is just too bazaar not to have an easy to miss cause.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Raistlen   (10 posts)  Bio
Date Reply #12 on Sun 22 Jun 2003 09:16 PM (UTC)
Message
The includes are:


#include <sys/types.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include "mud.h"

Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #13 on Sun 22 Jun 2003 09:18 PM (UTC)
Message
try adding math.h to the includes and see what happens

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Raistlen   (10 posts)  Bio
Date Reply #14 on Sun 22 Jun 2003 09:53 PM (UTC)
Message
Same deal as the very first one.


misc.c:3210: error: invalid operands to binary +
make[1]: *** [misc.o] Error 1
make[1]: Leaving directory `/home/raistlen/swrip/src'
make: *** [all] Error 2

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.


65,735 views.

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