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 11-08-2002, 08:47 PM   #1
TheDemonMaster
Member
 
Join Date: May 2002
Location: Maryland
Posts: 54
TheDemonMaster is on a distinguished road
Send a message via AIM to TheDemonMaster Send a message via MSN to TheDemonMaster Send a message via Yahoo to TheDemonMaster
Talking

I am trying to get the double exp code in and ran into this problem!

act_wiz.c: In function `do_doublexp':
act_wiz.c:5797: `doublexp' undeclared (first use in this function)
act_wiz.c:5797: (Each undeclared identifier is reported only once
act_wiz.c:5797: for each function it appears in.)
act_wiz.c:5809: warning: implicit declaration of function `do_announce'
make: *** [act_wiz.o] Error 1

Could someone explain as to what i am looking for? So i can learn.

Thanks!
 
TheDemonMaster is offline   Reply With Quote
Old 11-08-2002, 10:24 PM   #2
Loriel
Member
 
Join Date: May 2002
Posts: 49
Loriel is on a distinguished road
Your problem is in line 5797 of act_wiz.c.

The word "doublexp" is not being recognised by the compiler.

This usually arises because you are using a function that is "not known" at this point - generally because it lies in a different file.

This problem is solved by "declaring" that function in the main header file (merc.h, mud.h, or whatever your version is called) - this effectively tells the compiler "Don't worry about it now - it'll get sorted out later (at linking)".

Alternatively the function you are referring to might occur later in the same file - similar solution, declare it which means "Don't worry about it, it will get fixed later".

Declaring means just entering the opening line of the function, including the parameter/argument types, followed by a semicolon - eg:
void my_function(int, char);

Thus the problem usually arises because the "other" function has not been declared in the header file, or an out-of-date version of the header file is used somewhere in the code (ie you should have ensured it was all updated by using "make clean"), or possibly the other file where it is actually found hasn't been included (ie the "new" file hasn't been added to the list of .o files in the makefile).

However, it's also worth checking if you have a typo on that line - ie it's looking for the "wrong thing" in some way.

If none of these works, post the offending line (with a few lines either side).
Loriel is offline   Reply With Quote
Old 11-12-2002, 11:35 AM   #3
Torren
New Member
 
Join Date: Apr 2002
Posts: 28
Torren is on a distinguished road
Helps if you tell us which code base. I see act_wiz.c I'm going out on a limb and say a Diku/Merc flavor.
Silly me when I declare a fuction I use the args var
i.e.
void check_sex args( ( CHAR_DATA *ch) );
Now the next question is. What is doubleexp inside the do_doublexp function? Is it a var or is it a function call? if its a var then you'll have to define it at the begin of the function at the very least or in a loop/if statment.
With your second error you trying to call the function
do_announce, again I'm going to assume your using Merc/Diku/Rom/Rot and the function should be
do_announcement. How ever this function just turns the announcements on and off. If you wanted to announce something to the whole mud, use the announcement function.

Torren
Torren is offline   Reply With Quote
Reply


Thread Tools


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 01:03 AM.


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