Solved

Undeclared: NI_NUMERICHOST,NI_NOFQDN,+

Posted on 1998-11-09
4
784 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 50 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

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 …
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

749 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