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
➜ SMAUG coding
➜ DNS
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| USER007
(124 posts) Bio
|
Date
| Fri 10 Dec 2004 12:31 AM (UTC) Amended on Fri 10 Dec 2004 12:39 AM (UTC) by USER007
|
Message
| I installed the dns snippet, but I get these compiling errors:
Compiling o/comm.o....
comm.c: In function `new_descriptor':
comm.c:787: warning: unused variable `from'
comm.c: In function `close_socket':
comm.c:953: warning: implicit declaration of function `waitpid'
Compiling o/comments.o....
struct sockaddr_in sock;
struct hostent *from; <--- 787
int desc;
kill( dclose->ipid, SIGKILL );
waitpid( dclose->ipid, &status, 0 ); <--- 953
Any thoughts?
SmaugFUSS /XP/SP2 | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #1 on Fri 10 Dec 2004 12:39 AM (UTC) |
Message
| Looks like you need:
#include <netdb.h>
Try "man gethostbyname".
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| USER007
(124 posts) Bio
|
Date
| Reply #2 on Fri 10 Dec 2004 12:42 AM (UTC) |
Message
| The file has #include <netdb.h> in it. As for the "man gethostbyname" you lost me. | Top |
|
Posted by
| Greven
Canada (835 posts) Bio
|
Date
| Reply #3 on Fri 10 Dec 2004 01:15 AM (UTC) Amended on Fri 10 Dec 2004 01:24 AM (UTC) by Greven
|
Message
| What Nick means is to use the manual pages that are commonly available through any *nix shell. In this case, just type in:
man gethostbyname
This will give you very specific details on the system function called gethostname, as well as giving any dependancies that are needed, like the include file.
As for your waitpid warming, checking "man waitpid", it say that you need:
#include <sys/types.h>
#include <sys/wait.h>
Make sure you have both of those in your include file. |
Nobody ever expects the spanish inquisition!
darkwarriors.net:4848
http://darkwarriors.net | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #4 on Fri 10 Dec 2004 01:23 AM (UTC) |
Message
| Also, you didn't get errors, you got warnings. One of your warnings happens to be harmless (the unused one) and the implicit declaration might not matter, even if it's better not to have it. Did you get linker errors? |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
Posted by
| USER007
(124 posts) Bio
|
Date
| Reply #5 on Fri 10 Dec 2004 01:53 AM (UTC) |
Message
| The manuals didn't work, but I got both of the "warnings" fixed. :) I was missing the #include <sys/wait.h> in the file. As for the "from", it wasn't being used so I commented it out. Thanks for the help. | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #6 on Fri 10 Dec 2004 02:09 AM (UTC) |
Message
| I tried Google "man gethostbyname" - the first page that appeared was an example of that manual page. |
- 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.
18,558 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top