![]() |
#1 |
Member
Join Date: Apr 2002
Posts: 41
![]() |
ok, samson was his cool self and put in imc/i3 code into my src for me. I am running a modified SMAUG 1.4a. I try to compile it, but compile crashes with a lot of new errors. I am only going to mention the last few.
[code] Comm.o; in function 'nanny' comm.c;1655; undefined reference to 'crypt' comm.c;1722; undefined reference to 'crypt' comm.c 1763; undefined reference to 'crypt' save.o; in function 'save_char_obj'; save.c;193; undefined reference to 'RENAME' save.c;260; undefined reference to 'RENAME' collect2;ld 1 returned exit 1 status [make1]; ***[smaug] Error 1 [make]; ***[all] Error 2 [/quote] People I have talked to so far that the code in and around the lines look good. I am not much of a coder yet, so I am lost. Any input from anybody? *forgot to mention* when it compiles save.c and comm.c, they compile without any errors, its just when they make the .o files it crashes. |
![]() |
![]() |
![]() |
#2 |
Member
|
As for crypt.. try putting -DNOCRYPT in your makefile (I forget what SMAUG's makefile is like but look for C_FLAGS)
What system are you using anyhow? As far as I know crypt is now distrubted with all linux os's and even with cygwin.. you should also try to put -lcrypt in the makefile first, in L_FLAGS if it's there. As for the RENAME problem, do a search for where it is declared (look for a function prototype or an extern, probably in a .h file). Sorry, I don't like confusion... when the files are compiled they are turned into object code (the compile step makes them .o files). The .o files are then linked together to make the binary, so the make is puking on the linking stage. Good luck |
![]() |
![]() |
![]() |
#3 |
Member
Join Date: Apr 2002
Posts: 41
![]() |
|
![]() |
![]() |
![]() |
#4 |
Member
Join Date: Apr 2002
Posts: 41
![]() |
build.c:5885(or somewhere close)implictic declaration of 'RENAME'
could this be linked to my problem? |
![]() |
![]() |
![]() |
#5 |
Member
|
|
![]() |
![]() |
![]() |
#6 |
Member
Join Date: Apr 2002
Posts: 41
![]() |
ok, I recompiled and got this new error after I added to the makefile.
[code] act_comm.o;In function 'is_profane'; act_comm.c;3347; undefinded reference to 're_exec' act_info.o; In function 'do_hset'; act_info.c;2041; undefined reference to 'RENAME' act_wiz.o; in function 'do_balzhur' act_wiz.c;3258; undefined reference to 'RENAME' act_wiz.o In function 'do_mortalize' act_wiz.c;4880; undefined reference to 'RENAME' act_wiz.o; In function 'do_destroy'; act_wiz.c;5756; undefined reference to 'RENAME' act_wiz.c;5784; undefined reference to 'RENAME' act_wiz.c;9914; more undefinded reference to 'RENAME' follow 9914 collect2; ld returned exit 1 status [/quote] yes, all this from 2 changes in the make file... |
![]() |
![]() |
![]() |
#7 |
Member
Join Date: Apr 2002
Posts: 41
![]() |
ok, heres the stuff around save.c:193
[code] if ( IS_SET( sysdata.save_flags, SV_BACKUP ) || ( IS_SET( sysdata.save_flags, SV_QUITBACKUP ) && quitting_char == ch )) { sprintf( strback,"%s%c/%s",BACKUP_DIR,tolower(ch->pcdata->filename[0]), capitalize( ch->pcdata->filename ) ); RENAME( strsave, strback ); } [/quote] That all is for auto-backup of pfiles. Here is stuff around save.c:260 [code] fwrite_char( ch, fp ); if ( ch->morph ) fwrite_morph_data ( ch, fp ); if ( ch->first_carrying ) fwrite_obj( ch, ch->last_carrying, fp, 0, OS_CARRY ); if ( sysdata.save_pets && ch->pcdata->pet ) fwrite_mobile( fp, ch->pcdata->pet ); if ( ch->comments ) /* comments */ fwrite_comments( ch, fp ); /* comments */ fprintf( fp, "#END\n" ); ferr = ferror(fp); fclose( fp ); if (ferr) { perror(strsave); bug("Error writing temp file for %s -- not copying", strsave); } else RENAME(TEMP_FILE, strsave); } re_equip_char( ch ); quitting_char = NULL; saving_char = NULL; return; } [/quote] this part is for immortal statues, levels, vnums, ect according to Thoric's comments. |
![]() |
![]() |
![]() |
#8 |
Member
|
|
![]() |
![]() |
![]() |
#9 |
Member
Join Date: Apr 2002
Posts: 41
![]() |
hehe..from what I have heard..Gammon did something to his file and screwed up something within the files before I re-downloaded the src. Your doubts are right..didnt work...bleh
|
![]() |
![]() |
![]() |
#10 |
Member
Join Date: Apr 2002
Location: United Socialist States of America
Home MUD: SmaugMuds.org
Home MUD: Arthmoor MUD Hosting
Posts: 249
![]() |
Bah. It just ocurred to me what the problem is now that I see it's because of RENAME, in all caps like that. Ran into this with a client I'm hosting, and this is how we fixed his. In misc.c, at the VERY bottom you have this:
// to emulate Unix rename - we must delete the newpath first int RENAME (const char * oldpath, const char * newpath) { remove (newpath); return rename (oldpath, newpath); } What you need to do is add this below it: #else int RENAME( const char *oldpath, const char *newpath ) { return rename( oldpath, newpath ); } This should fix the problem. DONT remove the #endif that is at the very bottom of the file. It's quite necessary. Try it, since I have no way to verify that this will actually solve it under Cygwin. |
![]() |
![]() |
![]() |
#11 |
Member
Join Date: Apr 2002
Posts: 41
![]() |
[code]
act_comm.o;In function 'is_profane'; act_comm.c;3347; undefinded reference to 're_exec' collect2; ld exit 1 status /*I think thats how it goes, doing this from school*/ [/quote] This is the only error left in the compile that is crashing it from what I can see. I feel that the collect2 thingy means something. But thanks samson, all the other errors are gone now. |
![]() |
![]() |
![]() |
#12 |
Senior Member
|
![]() re_exec() is another BSD function that evaluates a previously compiled regular expression against a string you pass to it. I find it interesting that re_exec() is giving you problems but re_comp() is not -- if you don't call re_comp() at all, your re_exec() evaluation will always be 1 (true).
It's also possible that you don't have re_exec(), and will have to use some other method of checking. I've found that many codebases have the nasty habit of manually declaring prototypes to functions that may not otherwise exist. Try doing: grep "int re_exec" *.h to see if it's being manually declared, and if it is, remove it and use #include <regex.h> instead. If your system does not support BSD regular expressions, you'll probably have to remove the check or roll your own profanity filter, which isn't hard. |
![]() |
![]() |
![]() |
#13 |
Member
Join Date: Apr 2002
Posts: 41
![]() |
|
![]() |
![]() |
![]() |
#14 |
Senior Member
|
![]() It shouldn't return anything if it didn't find a manual prototype, and it shouldn't find a manual prototype. So that's good =).
Now the next one -- You need re_comp() for re_exec() to work properly. Do "grep re_comp *.[ch]". If that doesn't return anything either, you might as well just comment out the is_profane check (make it always return false), because it's not going to work anyway. You should try commenting out the entire function body so that your mud will at least compile =). Then perhaps you could paste your is_profane() function so that we could find a workaround. |
![]() |
![]() |
![]() |
#15 |
Member
Join Date: Apr 2002
Posts: 41
![]() |
[code]
act_comm.c; preg = re_comp( bigregex ); mud.h #include <re_comp.h> [/quote] That is what it returned |
![]() |
![]() |
![]() |
#16 |
Member
Join Date: Apr 2002
Location: United Socialist States of America
Home MUD: SmaugMuds.org
Home MUD: Arthmoor MUD Hosting
Posts: 249
![]() |
In your Makefile, you have these 2 lines:
#Uncomment the line below if you are getting implicit decleration of re_exec #REG = -DREGEX Take the # off the second line, recompile, and see if that solves it. If it doesn't then you may simply have to take the profanity filter out. |
![]() |
![]() |
![]() |
#17 |
Member
Join Date: Apr 2002
Posts: 41
![]() |
Profanity filter is commented out, yet we get a new error. *mental note: gripe at gammon* ok, heres whats next.
[code] act_comm.c;36; parse error before '_RE_ARGS_' [/quote] Here is whats around what it errored at. [code] #ifdef REGEX extern int re_exec _RE_ARGS ((const char *)); #endif [/quote] Two other people are already looking around at it, but I want to see if I can get some input from u all. |
![]() |
![]() |
![]() |
#18 |
Member
Join Date: Apr 2002
Posts: 41
![]() |
Bleh, nobody knows? I havn't heard a peep out of the two people looking at it for two days..
|
![]() |
![]() |
![]() |
#19 |
Member
Join Date: Apr 2002
Location: United Socialist States of America
Home MUD: SmaugMuds.org
Home MUD: Arthmoor MUD Hosting
Posts: 249
![]() |
Heh. Was waiting to see if they solved it or something. Simple solution here would be to just comment out that line causing the problem. Especially if you've commented the filter code out already.
|
![]() |
![]() |
![]() |
#20 |
Senior Member
|
![]() [/quote]
There's that manual declaration! It's in the implementation file, not the header file. *sighs*, I'll never understand what was going through their minds... At any rate, that's most definately what's causing your problems. On my system, the re_comp.h header file is simply an alias for regex.h. Since you manually declare it here, I'm willing to bet that this declaration differs from the one in regex.h. So REMOVE the "extern int re_exec..." line, and replace it with "#include <regex.h>", and it should solve your problem. If it compiles that way, you can go remove the comments around the is_profane() check. |
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
error when trying to compile | UnKnOwN | MUD Coding | 0 | 04-07-2006 02:53 PM |
Crashing | Keljorian | MUD Coding | 7 | 01-03-2004 09:37 AM |
Compile error | melker | MUD Coding | 37 | 07-22-2002 02:23 PM |
Rom 2.4 Mob errors | Torren | MUD Coding | 8 | 05-08-2002 08:58 PM |
Circle - Death Gate make errors | Eagleon | MUD Coding | 11 | 04-20-2002 10:43 AM |
|
|