Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ Compiling the server
➜ Implicit declarations?
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Mixoplix
(8 posts) Bio
|
| Date
| Tue 06 Aug 2002 12:28 AM (UTC) |
| Message
| What exactly would an error message stating:
implicit declaration of function 'blah blah blah' mean?
I get a few of those every now and than and was just wondering what it meant. Thanks
Mixoplix | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Tue 06 Aug 2002 01:00 AM (UTC) |
| Message
| It is caused by calling a function that doesn't have a function prototype, or which hasn't been declared earlier (in full).
Usually this is because there is a missing xx.h file at the start of the source file. If it is an inbuilt function (eg. printf) then look at the help for that and include the appropriate file (eg. #include <stdio.h>).
If it is a SMAUG function do a grep to find the appropriate .h file, and include that. If you can't find that, find the actual declaration for the function, and do a prototype at the start of the file where it is called. Just picking an example at random, say the function in question was "do_mset" then you would find "do_mset" in file build.c, which is:
void do_mset( CHAR_DATA *ch, char *argument )
{
char arg1 [MAX_INPUT_LENGTH];
char arg2 [MAX_INPUT_LENGTH];
... and so on ...
Then, take the declaration line and add a semicolon, like this:
void do_mset( CHAR_DATA *ch, char *argument );
This is then a "function prototype" which you can then put in another source file, before where it is used. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
10,571 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top