Solved

Undeclared: NI_NUMERICHOST,NI_NOFQDN,+

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now