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
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
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
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:
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.
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.
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
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.
(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
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?
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
(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;
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