Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Undeclared: NI_NUMERICHOST,NI_NOFQDN,+

Posted on 1998-11-09
4
Medium Priority
?
836 Views
Last Modified: 2012-05-04
I bought a book entitled Unix Network Programming (W. Richard Stevens, ISBN: 0-13-490012-x) and it referenced an FTP site to download all the source code from the book: ftp://ftp.kohala.com/pub/rstevens/unpv12e.tar.gz.

Now when I commenced running the MAKE file for the drawer /libgai, it gave the following error messages during compiling:
gn_ipv46.c: NI_NUMERICHOST undeclared
gn_ipv46.c: NI_NOFQDN undeclared
gn_ipv46.c: NI_NAMEREQD undelcared
gn_ipv46.c: NI_NUMERICSERV undeclared
gn_ipv46.c: NI_DGRAM undelcared
make: *** [gn_ipv46.o] error 1 ***

I left numerous email messages to the author W. Richard Stevens, but he continues to ignore my pleas for help.  These authors...

Would you by chance know of the missing file which the MAKE file requires in order to get these variables declared?  These items appear to be #define but I could be wrong.

Thanks so much for ANY help you can provide me.

Jim.
0
Comment
Question by:ratboy2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 5

Expert Comment

by:JBURGHARDT
ID: 1638462
You get more help if you post this question in programing section
this program is in c.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1638463
what is the result of following command in the directory:

  find . \*.h -exec grep NI_N {} \; | grep define

please also post the   cc   comandline reported by make
0
 

Author Comment

by:ratboy2
ID: 1638464
Thanks very much ahoffmann.
I used wpe's find to recurse through my dirs (before i saw your message) and sure enough i found these definitions inside a hidden .H file. I modified Stevens book code and it work smoothly from that point on..

If you would like the points for this question please reply back with the same answer.

Thanks

BTW you wouldnt by chance know how to get my local IP address while connected to the net in Linux would you? I am using "C" and from the book it says to call gethostname() followed by gethostbyname() putting the results from gethostname into it. When i do this it ALWAYS returns back "localip.localdomain". I remember seeing this value set in my HOSTIP area under X windows but i was hoping this ip address would change to match whatever my REAL IP address was while connected to the net.  
How do i go about doing this?
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 100 total points
ID: 1638465
find . \*.h -exec grep NI_N {} \; | grep define
then add found files to your include path (-I)

About your gethostbyname(), I'll check this question in C Language topic.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question