Solved

Undeclared: NI_NUMERICHOST,NI_NOFQDN,+

Posted on 1998-11-09
4
763 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
  • 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
php ssh2_scp_send 1 61
how to rebuild XFS volume from LV 19 64
Linux Copy Command - All Files inc Directory 1 42
CENTOS DHCP Server / PXE/TFTP 14 77
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
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.

777 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