Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
You're going to execute the make command. "<systype>" should be replaced with some text that specifies what kind of system you are running. There should be a list of recognized systems somewhere in the documentation. It could be anything: linux, i386, or many others. The angle brackets signify that you must supply this information to the command. "[options]" represents a list of command line items that will influence how make creates/compiles the software. The square brackets indicate that you do not need to include options; they are not required.
In all likelihood, you'll execute something like: make linux
Again, you need to find some kind of list in the documentation that tells you what possible values there are for systype. If you can't find anything, then you might have to paste the contents of the file named "Makefile" in that directory.
In function `****':
: warning: Using 'gethostbyaddr' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
is what i get now :-\
[root@localhost heh]# make linux
make -e nc XFLAGS='-DLINUX' STATIC=-static
make[1]: Entering directory `/home/heh'
cc -O -s -DLINUX -static -o nc netcat.c
/tmp/ccMYcLrv.o(.text+0x41e): In function `gethostpoop':
: warning: Using 'gethostbyaddr' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/tmp/ccMYcLrv.o(.text+0x368): In function `gethostpoop':
: warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/tmp/ccMYcLrv.o(.text+0x61c): In function `getportpoop':
: warning: Using 'getservbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/tmp/ccMYcLrv.o(.text+0x58f): In function `getportpoop':
: warning: Using 'getservbyport' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/tmp/ccMYcLrv.o(.text+0x150c): In function `main':
: undefined reference to `res_init'
collect2: ld returned 1 exit status
make[1]: *** [nc] Error 1
make[1]: Leaving directory `/home/heh'
make: *** [linux] Error 2
/tmp/ccMYcLrv.o(.text+0x150c): In function `main':
: undefined reference to `res_init'
collect2: ld returned 1 exit status
make[1]: *** [nc] Error 1
Basically, what that is saying is the computer can't find what it's supposed to do when told to "res_init" something. The details are not important. This is a problem stemming from one of two things:
1. The system does not have needed support files installed (usually referred to as libraries)
2. You might have to supply some value on the command line for the "[options]" part above.
What software are you trying to install? I can download it and take a look at the documentation and try to point you in the right direction.
heres what the doc for thr pogram says abuot building it
Compiling is fairly straightforward. Examine the Makefile for a SYSTYPE that
matches yours, and do "make <systype>". The executable "nc" should appear.
If there is no relevant SYSTYPE section, try "generic". If you create new
sections for generic.h and Makefile to support another platform, please follow
the given format and mail back the diffs.
There are a couple of other settable #defines in netcat.c, which you can
include as DFLAGS="-DTHIS -DTHAT" to your "make" invocation without having to
edit the Makefile. See the following discussions for what they are and do.
If you want to link against the resolver library on SunOS [recommended] and
you have BIND 4.9.x, you may need to change XLIBS=-lresolv in the Makefile to
XLIBS="-lresolv -l44bsd".
Ok, looking at the source code in netcat.c, here's where res_init is used:
Code:
/* can *you* say "cc -yaddayadda netcat.c -lresolv -l44bsd" on SunLOSs? */
res_init();
It would appear that "res_init" (probably short for resource initialization) is necessary for SunOS or possibly FreeBSD. I commented out the line by changing it to:
Code:
/* can *you* say "cc -yaddayadda netcat.c -lresolv -l44bsd" on SunLOSs? */
/* res_init(); */
Running make linux ran to completion after doing so. Essentially we're just telling the compiler to ignore that particular part of the program.
So, not being one to lightly make these kinds of changes, a google search using "netcat res_init" returns a few pages where they talk about doing exactly this. So it's a standard "fix". The developers just simply did not test the software on every platform to find this particular problem.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.