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!
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.
I am new to Linux (and working with computers in general) and I wanted to know more about the programming and libraries. Specifically, I wanted to know where the libraries are stored on the computer. Also, does the compiler come with libraries or does your compiler soley rely on the libraries stored on the computer (I am using GCC)? Also, I don't really understand the compiler process. From what I gather the compiler convertes the code you write into machine language (is that binary?) and it also "links" libraries (pre-compiled code?) and your different files together. I am not really sure how that linking works. So, it would be great if anyone has any good info they want to share or point me in the right direction.
DEFAULT libraries are in one of (3?) places - /usr/lib64 (for 64 bit libraries), /usr/lib (32 bit libraries), /usr/local/lib ...
The /usr/local/lib is frequently used to to hold site (your site) specific application/libraries, hence the /usr/local directory tree usually includes a bin, etc, lib...
Some development libraries are not always installed. The normally installed libraries are shared libraries - meaning that only one memory resident version exists, but are mapped into many processes memory range. Development libraries are usually named xxx.a, meaning "archive". Sometimes these libraries include debugging modules, as well as including debugging symbols. Both can be useful during development.
It is up to the distribution to decide how to package such things. frequently the compiler will only include the base runtime libraries (the .a) because there are so MANY different libraries (X has a couple of dozen, then there are more for C++, Fortran, GUI toolkits...)
The compiler proper only translates from the source code to a ".o" file (meaning "object"). A separate linker will combine these together (usually, the link phase is automatically done for simple programs). Libraries are created using a different utility (ar - for "archiver"). Shared libraries are created by the linker (ld - for "link edit") by giving it specific options.
Nearly all compilers have multiple passes/phases:
1. preprocessor - scan the file creating/expanding macros, adding definitions (prototypes) for library functions. The output is then passed to
2. the scanner/tokenizer/compiler (may be all one unit). The output of this is usually passed to
3. an optimizer which tries to optimize speed/memory usage which sometimes outputs to a
4. code generator that generates the final object file.
If it is a relatively simple (or at the end of a long series of compiles) the compiler can then invoke a linker that combines all the listed object files, libraries referenced (or implied - gcc assumes you are going to use libc, so normally you don't have to give that one)
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
yes and no
you don't 'include' libraries, you include HEADERS, which are re-usable parts of other parts of programs, such as libraries, that allow developers to interact with said programs/libraries at a programming level, or to perform tasks without 'reinventing the wheel', such as stdio.h http://en.wikipedia.org/wiki/Header_file
and in answer to your second query, nothing is 'included' by the compiler by default, any header you need must be explicitly included.