07 Sep, 2009, DK p1990 wrote in the 1st comment:
Votes: 0
Ok everyone i have got some awsome people helping me from this site and i need to combard you with questions so i am getting this list of errors when i make whill im in the src directory and i am using cygwin if that matters also i am using crimson editor so i can get to the lines the errors are on pretty easily but if you could explain some of these why they occur instead of telling me how to fix them that would be great if not helping fix would be awsome in itself!

make swr
make[1]: Entering directory `/cygdrive/c/Nmud/holdall/swrots/src'
gcc -c -g3 -Wall act_info.c
act_info.c: In function `do_password':
act_info.c:2910: warning: implicit declaration of function `crypt'
act_info.c:2910: warning: passing arg 1 of `strcmp' makes pointer from integer w
ithout a cast
act_info.c:2927: warning: assignment makes pointer from integer without a cast
gcc -c -g3 -Wall fight.c
fight.c:8:21: sys/dir.h: No such file or directory
make[1]: *** [fight.o] Error 1
make[1]: Leaving directory `/cygdrive/c/Nmud/holdall/swrots/src'
make: *** [all] Error 2
07 Sep, 2009, kiasyn wrote in the 2nd comment:
Votes: 0
When posting a compile error if you can include the lines that are having the problem that would help a lot.
07 Sep, 2009, DK p1990 wrote in the 3rd comment:
Votes: 0
when i do make thats all that comes up

make[1]: Entering directory `/cygdrive/c/Nmud/holdall/swrots/src'
gcc -c -g3 -Wall act_info.c
act_info.c: In function `do_password':
act_info.c:2910: warning: implicit declaration of function `crypt'
act_info.c:2910: warning: passing arg 1 of `strcmp' makes pointer from integer w
ithout a cast
act_info.c:2927: warning: assignment makes pointer from integer without a cast
gcc -c -g3 -Wall fight.c
fight.c:8:21: sys/dir.h: No such file or directory
make[1]: *** [fight.o] Error 1
make[1]: Leaving directory `/cygdrive/c/Nmud/holdall/swrots/src'
make: *** [all] Error 2
07 Sep, 2009, DK p1990 wrote in the 4th comment:
Votes: 0
ok now its putting this out when i make

make[1]: Entering directory `/cygdrive/c/nmud/holdall/swrots/src'
gcc -c -g3 -Wall fight.c
fight.c:8:21: sys/dir.h: No such file or directory
make[1]: *** [fight.o] Error 1
make[1]: Leaving directory `/cygdrive/c/nmud/holdall/swrots/src'
make: *** [all] Error 2

i know the last mud i had was a bit easier then this one to get going for some reason…i am unsure where to go from here because its giving fight.c and o errors but that should not keep it from booting it should just boot and have problems with the code of combat
07 Sep, 2009, Kline wrote in the 5th comment:
Votes: 0
fight.c:8:21: sys/dir.h: No such file or directory

You're trying to include a header file you don't have.
07 Sep, 2009, Tyche wrote in the 6th comment:
Votes: 0
dkp1990 said:
act_info.c: In function `do_password':
act_info.c:2910: warning: implicit declaration of function `crypt'


crypt() is declared in unistd.h, so you must include that header in act_info.c


dkp1990 said:
fight.c:8:21: sys/dir.h: No such file or directory


Change the include in fight.c to
#include <dirent.h>
07 Sep, 2009, DK p1990 wrote in the 7th comment:
Votes: 0
so to include it i need to do

#include <crypt()>

—————————————————————————————————————

After doing the fight.c file i tried make again and got much further but am getting this put out before it shuts down changed the sys/dir.h to dirent.h to get rid of some errors but im still getting some that i don't understand if you could explain when telling me how to fix again that would be great cuz then when i see more erros i might be able to fix some of them on my own im a pretty fast learner…thanks for your help

make[1]: Entering directory `/cygdrive/c/nmud/holdall/swrots/src'
gcc -c -g3 -Wall save.c
save.c: In function `load_corpses':
save.c:2343: warning: assignment from incompatible pointer type
save.c:2345: error: dereferencing pointer to incomplete type
save.c:2347: error: dereferencing pointer to incomplete type
make[1]: *** [save.o] Error 1
make[1]: Leaving directory `/cygdrive/c/nmud/holdall/swrots/src'
make: *** [all] Error 2
08 Sep, 2009, David Haley wrote in the 8th comment:
Votes: 0
Quote
save.c:2345: error: dereferencing pointer to incomplete type
save.c:2347: error: dereferencing pointer to incomplete type

Could you post the lines in question?

Also I have some trouble reading your long sentences without punctuation; would you mind throwing in some periods here and there? :wink:
08 Sep, 2009, DK p1990 wrote in the 9th comment:
Votes: 0
Ok these are what are holding me up.

save.c:2343: warning: assignment from incompatible pointer type
save.c:2345: error: dereferencing pointer to incomplete type
save.c:2347: error: dereferencing pointer to incomplete type

If i can get these couple errors fixed i think the rest will compile just fine. Though i have fixed the couple that were obvious to me.

these are the line from my save.c code.

{line 2343} while ( (de = readdir(dp)) != NULL )

{line 2345} if ( de->d_name[0] != '.' )

{line 2347} sprintf(strArea, "%s%s", CORPSE_DIR, de->d_name );
08 Sep, 2009, David Haley wrote in the 10th comment:
Votes: 0
What type is 'de'? You need to check the return type of readdir (try: man readdir) and make sure that 'de' is of the right type. Then, you need to make sure that you have the appropriate header file #include'd at the top of your .c file: the manpage above will tell you which file that is.
08 Sep, 2009, Tyche wrote in the 11th comment:
Votes: 0
dkp1990 said:
so to include it i need to do

#include <crypt()>


No, crypt() is declared in unistd.h so you have to include unistd.h like so…
#include <unistd.h>

dkp1990 said:
{line 2343} while ( (de = readdir(dp)) != NULL )


readdir() under cygwin returns 'struct dirent'.
So de should be declared..

struct dirent de;

instead of whatever it is declared as which is somewhere in your code before the above line.
08 Sep, 2009, DK p1990 wrote in the 12th comment:
Votes: 0
The save.c has that #include in it. These are all the ones that are in the save.c file

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

Not sure what you mean by lines in question i am just posting what cygwin gives me though i think only three of these lines are errors….see i'm doing correspondance school for data structure but its slow an tedious even with reading mounds of books so here is what is spit out when i make

make[1]: Entering directory `/cygdrive/c/nmud/holdall/swrots/src'
gcc -c -g3 -Wall save.c
save.c: In function `load_corpses':
save.c:2343: warning: assignment from incompatible pointer type
save.c:2345: error: dereferencing pointer to incomplete type
save.c:2347: error: dereferencing pointer to incomplete type
make[1]: *** [save.o] Error 1
make[1]: Leaving directory `/cygdrive/c/nmud/holdall/swrots/src'
make: *** [all] Error 2

Sorry if i am being repeditive with posting this i am not meaning to be annoying but i am tryiong to get things explained more then they are when i find things in books. Its easier for me to understand things when a person puts it in a different perspective other then a lectured formate
09 Sep, 2009, Tyche wrote in the 13th comment:
Votes: 0
The error with crypt() not being declared occurs in act_info.c, not save.c
Therefore #include <unitstd.h> is not present in act_info.c.

save.c:2345: error: dereferencing pointer to incomplete type
save.c:2347: error: dereferencing pointer to incomplete type

The above errors refer to how 'de' is declared, which is not evident from looking at only the lines referenced in the error messages.
I can't see that code, only you can see it.
My mistake in the last message, 'de' ought to be declared as..

struct dirent * de;

Find the declaration in your code, which occurs somewhere before line 2343, and fix it.
10 Sep, 2009, DK p1990 wrote in the 14th comment:
Votes: 0
(error in cygwin) save.c:2343: warning: assignment from incompatible pointer type

(line 2343) while ( (de = readdir(dp)) != NULL )

these are all the lines i have found containing dp

(line 2329) DIR *dp;
(line 2335) if ( !(dp = opendir(CORPSE_DIR)) )
(line 2343) while ( (de = readdir(dp)) != NULL )
(line 2388) closedir(dp);

These lines are from the save.c file was not sure if i should check in any other files for dp to see if its declared anywhere if i am please let me know
10 Sep, 2009, elanthis wrote in the 15th comment:
Votes: 0
Just do exactly what Tyche told you to do. He put it about as clear as he could. Fix the declaration of de to be of type struct dirent *
11 Sep, 2009, DK p1990 wrote in the 16th comment:
Votes: 0
well i looked for the delaration and i could not find one in the save.c file would there be another file that would have a declaration that would affect this file?
11 Sep, 2009, DK p1990 wrote in the 17th comment:
Votes: 0
There is no declaration in any file that i can find for de so what code line do i put to declare it. This is the define line that i found for it in the <mud.h> file

/*this is the file from mud.h i found*/ #define DE DEITY_DATA

not sure what the DO_FUN is all about but im gunna google it because i seen it in every declare line there was so if that is the lone i need to put in please tell me if not let me know what im doing wrong and how i can fix it or what information i need to give to get it resolved
11 Sep, 2009, Sharmair wrote in the 18th comment:
Votes: 0
It should be at the start of the function which should look something like this:
void load_corpses(void)
{
DIR* dp;
struct dirent* de;
extern FILE* fpArea;
extern char strArea[MAX_INPUT_LENGTH];
extern int falling;
int iNest;

if(!(dp = opendir(CORPSE_DIR)))

Note line 4.
11 Sep, 2009, DK p1990 wrote in the 19th comment:
Votes: 0
when i changed to that i got an additional thing saying…

save.c:2334: warning: unused variable `iNest'

/*This is what i have before i made it look like yours*/

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

/*Changed it to look like the one you posted and it gave me all the same errors i had play the save.c:2334: warning: unused variable `iNest'*/
11 Sep, 2009, Tyche wrote in the 20th comment:
Votes: 0
dkp1990 said:
(line 2329) DIR *dp;
(line 2335) if ( !(dp = opendir(CORPSE_DIR)) )
(line 2343) while ( (de = readdir(dp)) != NULL )
(line 2388) closedir(dp);


I can't imagine that de is declared too far before line 2243.
So unless you have a link to the base code you are using, like it being based off something the repository here,
I suspect you'll just have to post us around 50-75 lines before line 2343.
Otherwise we're just playing a guess what my code looks like game. ;-)

Edit: wrote post before last two. Seems the error is solved now.

Err maybe not…

You do understand that you should change the line
struct direct * de;
to
struct dirent * de;

And not just copy everything he posted literally.
0.0/23