Top Mud Sites Forum Return to TopMudSites.com
Go Back   Top Mud Sites Forum > Mud Development and Administration > MUD Coding
Click here to Register

Reply
 
Thread Tools
Old 04-25-2002, 06:44 AM   #1
Sevoric
Member
 
Join Date: Apr 2002
Posts: 41
Sevoric is on a distinguished road
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.
Sevoric is offline   Reply With Quote
Old 04-25-2002, 08:30 AM   #2
Koryon
Member
 
Join Date: Apr 2002
Location: Canada
Posts: 50
Koryon is on a distinguished road
Send a message via ICQ to Koryon Send a message via MSN to Koryon
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).

Quote:
Originally Posted by
they compile without any errors, its just when they make the .o files it crashes.
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
Koryon is offline   Reply With Quote
Old 04-25-2002, 05:08 PM   #3
Sevoric
Member
 
Join Date: Apr 2002
Posts: 41
Sevoric is on a distinguished road
ok, I added the things to the make files. As for the RENAME problem..I have no clue what you are talking about. I dont know coding language yet I forgot tyo mention that the SMAUG is running off of win98
Sevoric is offline   Reply With Quote
Old 04-25-2002, 06:05 PM   #4
Sevoric
Member
 
Join Date: Apr 2002
Posts: 41
Sevoric is on a distinguished road
build.c:5885(or somewhere close)implictic declaration of 'RENAME'

could this be linked to my problem?
Sevoric is offline   Reply With Quote
Old 04-25-2002, 06:34 PM   #5
Koryon
Member
 
Join Date: Apr 2002
Location: Canada
Posts: 50
Koryon is on a distinguished road
Send a message via ICQ to Koryon Send a message via MSN to Koryon
Yes definatly, your compiler is warning you that you are using something that hasn't been defined yet, not a good thing to be sure

Maybe if you post that line and a few around it?
Koryon is offline   Reply With Quote
Old 04-25-2002, 06:53 PM   #6
Sevoric
Member
 
Join Date: Apr 2002
Posts: 41
Sevoric is on a distinguished road
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...
Sevoric is offline   Reply With Quote
Old 04-25-2002, 07:00 PM   #7
Sevoric
Member
 
Join Date: Apr 2002
Posts: 41
Sevoric is on a distinguished road
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.
Sevoric is offline   Reply With Quote
Old 04-25-2002, 08:04 PM   #8
Koryon
Member
 
Join Date: Apr 2002
Location: Canada
Posts: 50
Koryon is on a distinguished road
Send a message via ICQ to Koryon Send a message via MSN to Koryon
Well, this may or may not work, I can't be sure exactly what this RENAME is supposed to be, but you can try this (put in mud.h or whatever):

[code] #define RENAME(a,b) { free_string((a)); (a) = str_dup((b)); }[/quote]

I have my doubts that will work, but it's something to try.. did your mud compile fine before this? It doesn't seem like the imc/i3 code would edit those parts of save.c, and I doubt Samson would have screwed you on purpose
Koryon is offline   Reply With Quote
Old 04-25-2002, 09:58 PM   #9
Sevoric
Member
 
Join Date: Apr 2002
Posts: 41
Sevoric is on a distinguished road
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
Sevoric is offline   Reply With Quote
Old 04-26-2002, 04:59 AM   #10
Samson
Member
 
Samson's Avatar
 
Join Date: Apr 2002
Location: United Socialist States of America
Home MUD: SmaugMuds.org
Home MUD: Arthmoor MUD Hosting
Posts: 249
Samson is on a distinguished road
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.
Samson is offline   Reply With Quote
Old 04-26-2002, 12:46 PM   #11
Sevoric
Member
 
Join Date: Apr 2002
Posts: 41
Sevoric is on a distinguished road
[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.
Sevoric is offline   Reply With Quote
Old 04-26-2002, 01:53 PM   #12
Yui Unifex
Senior Member
 
Join Date: Apr 2002
Location: Florida
Posts: 323
Yui Unifex is on a distinguished road
Send a message via ICQ to Yui Unifex Send a message via AIM to Yui Unifex
Question

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.
Yui Unifex is offline   Reply With Quote
Old 04-26-2002, 04:29 PM   #13
Sevoric
Member
 
Join Date: Apr 2002
Posts: 41
Sevoric is on a distinguished road
ok, u making me fell stupid I did the grep and nothing came up, just a pause.
Sevoric is offline   Reply With Quote
Old 04-26-2002, 04:45 PM   #14
Yui Unifex
Senior Member
 
Join Date: Apr 2002
Location: Florida
Posts: 323
Yui Unifex is on a distinguished road
Send a message via ICQ to Yui Unifex Send a message via AIM to Yui Unifex
Question

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.
Yui Unifex is offline   Reply With Quote
Old 04-26-2002, 07:53 PM   #15
Sevoric
Member
 
Join Date: Apr 2002
Posts: 41
Sevoric is on a distinguished road
[code]
act_comm.c; preg = re_comp( bigregex );
mud.h #include <re_comp.h>
[/quote]

That is what it returned
Sevoric is offline   Reply With Quote
Old 04-26-2002, 09:25 PM   #16
Samson
Member
 
Samson's Avatar
 
Join Date: Apr 2002
Location: United Socialist States of America
Home MUD: SmaugMuds.org
Home MUD: Arthmoor MUD Hosting
Posts: 249
Samson is on a distinguished road
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.
Samson is offline   Reply With Quote
Old 04-27-2002, 01:07 AM   #17
Sevoric
Member
 
Join Date: Apr 2002
Posts: 41
Sevoric is on a distinguished road
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.
Sevoric is offline   Reply With Quote
Old 04-28-2002, 02:22 AM   #18
Sevoric
Member
 
Join Date: Apr 2002
Posts: 41
Sevoric is on a distinguished road
Bleh, nobody knows? I havn't heard a peep out of the two people looking at it for two days..
Sevoric is offline   Reply With Quote
Old 04-28-2002, 06:37 AM   #19
Samson
Member
 
Samson's Avatar
 
Join Date: Apr 2002
Location: United Socialist States of America
Home MUD: SmaugMuds.org
Home MUD: Arthmoor MUD Hosting
Posts: 249
Samson is on a distinguished road
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.
Samson is offline   Reply With Quote
Old 04-28-2002, 09:08 AM   #20
Yui Unifex
Senior Member
 
Join Date: Apr 2002
Location: Florida
Posts: 323
Yui Unifex is on a distinguished road
Send a message via ICQ to Yui Unifex Send a message via AIM to Yui Unifex
Question

Quote:
Originally Posted by (Yui Unifex @ last episode)
I've found that many codebases have the nasty habit of manually declaring prototypes to functions that may not otherwise exist.
Quote:
Originally Posted by (Sevoric @ blah)
Here is whats around what it errored at.
[code] #ifdef REGEX
extern int re_exec _RE_ARGS ((const char *));
#endif
[/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.
Yui Unifex is offline   Reply With Quote
Reply


Thread Tools


Errors crashing compile - Similar Threads
Thread Thread Starter Forum Replies Last Post
error when trying to compile UnKnOwN MUD Coding 0 04-07-2006 03:53 PM
Crashing Keljorian MUD Coding 7 01-03-2004 10:37 AM
Compile error melker MUD Coding 37 07-22-2002 03:23 PM
Rom 2.4 Mob errors Torren MUD Coding 8 05-08-2002 09:58 PM
Circle - Death Gate make errors Eagleon MUD Coding 11 04-20-2002 11:43 AM

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -4. The time now is 08:24 PM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Style based on a design by Essilor
Copyright Top Mud Sites.com 2014