[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  Compiling the server
. . -> [Subject]  Cygwin/SWR Compiling Problem.

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Cygwin/SWR Compiling Problem.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Maruku   (3 posts)  [Biography] bio
Date Wed 23 Jul 2003 07:23 AM (UTC)  quote  ]
Message
When trying to compile SWR on Cygwin, I keep getting the following error, no matter what I've been told by anyone I know.. :

make swreality
make[1]: Entering directory `/home/Adam1/swr/src'
gcc -c -g3 -Wall save.c
save.c: In function `load_char_obj':
save.c:913: warning: suggest explicit braces to avoid ambiguous `else'
save.c: In function `load_corpses':
save.c:2055: warning: assignment from incompatible pointer type
save.c:2057: dereferencing pointer to incomplete type
save.c:2059: dereferencing pointer to incomplete type
make[1]: *** [save.o] Error 1
make[1]: Leaving directory `/home/Adam1/swr/src'
make: *** [all] Error 2

If anyone can help, thanks a lot!
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Wed 23 Jul 2003 07:42 AM (UTC)  quote  ]
Message
It is hard to debug from just the error messages. Can you post the 10 lines preceding line 2059 in save.c, and indicate which are lines 2055, 2057 and 2059?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Maruku   (3 posts)  [Biography] bio
Date Reply #2 on Wed 23 Jul 2003 08:03 PM (UTC)  quote  ]
Message
void load_corpses( void )
{
DIR *dp;
struct direct *de;
extern FILE *fpArea;
extern char strArea[MAX_INPUT_LENGTH];
extern int falling;

if ( !(dp = opendir(CORPSE_DIR)) )
{
bug( "Load_corpses: can't open CORPSE_DIR", 0);
perror(CORPSE_DIR);
return;
}

falling = 1; /* Arbitrary, must be >0 though. */
while ( (de = readdir(dp)) != NULL )
{
if ( de->d_name[0] != '.' )
{
sprintf(strArea, "%s%s", CORPSE_DIR, de->d_name );
fprintf(stderr, "Corpse -> %s\n", strArea);
if ( !(fpArea = fopen(strArea, "r")) )
{
perror(strArea);
continue;
}
for ( ; ; )
{
char letter;
char *word;

letter = fread_letter( fpArea );
if ( letter == '*' )
{
fread_to_eol(fpArea);
continue;
}
if ( letter != '#' )
{
bug( "Load_corpses: # not found.", 0 );
break;
}
word = fread_word( fpArea );
if ( !str_cmp(word, "CORPSE" ) )
fread_obj( NULL, fpArea, OS_CORPSE );
else if ( !str_cmp(word, "OBJECT" ) )
fread_obj( NULL, fpArea, OS_CARRY );
else if ( !str_cmp( word, "END" ) )
break;
else
{
bug( "Load_corpses: bad section.", 0 );
break;
}
}
fclose(fpArea);
}
}
fpArea = NULL;
strcpy(strArea, "$");
closedir(dp);
falling = 0;
return;
}


Line 2055: while ( (de = readdir(dp)) != NULL )
Line 2057: if ( de->d_name[0] != '.' )
Line 2059: sprintf(strArea, "%s%s", CORPSE_DIR, de->d_name );
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Wed 23 Jul 2003 10:00 PM (UTC)  quote  ]
Message
Do you have this line near the start of save.c, without any #ifdef around it?


  #include <dirent.h>


If not, put it there. If there is an #ifdef remove it. ie, change:


#ifndef WIN32
  #include <dirent.h>
#endif


to


  #include <dirent.h>

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Maruku   (3 posts)  [Biography] bio
Date Reply #4 on Wed 23 Jul 2003 10:43 PM (UTC)  quote  ]
Message
Ack.. tried that, and still got the same error. Thanks anyway Nick!
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Thu 24 Jul 2003 02:58 AM (UTC)  quote  ]
Message
I got it to compile under Cygwin by adding one line. This is what the start of save.c looks like for me ...


#include <sys/types.h>
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <sys/stat.h>
#include <dirent.h>
#include "mud.h"

#define direct dirent  // add this line


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by GuidoHC   (10 posts)  [Biography] bio
Date Reply #6 on Tue 21 Aug 2007 04:26 AM (UTC)  quote  ]
Message
Nick, you are a genious! I been scrounging over these forums for a fix, and you had it!
[Go to top] 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.


2,737 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]