473,385 Members | 1,570 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Meaning of .a extension

Hi what are .a files used for? Are they a kind of archive to hold
libraries? I've installed a toolkit that puts some .h files into /usr/
local/src and a .a file into /usr/local/lib. However, I don't know how
to instruct the compiler to use the contents of the .a file, if it's
really needed and for what.

Cheers
Giuseppe
Jun 27 '08 #1
2 2007
Giuseppe.G. wrote:
Hi what are .a files used for? Are they a kind of archive to hold
libraries? I've installed a toolkit that puts some .h files into /usr/
local/src and a .a file into /usr/local/lib. However, I don't know how
to instruct the compiler to use the contents of the .a file, if it's
really needed and for what.
..a files in Unix are "archives" of object modules. They are basically
an equivalent of .lib files on Windows (if you're more familiar with
that environment). A .a file is used by the linker; if the name of the
file you need to add is libXXX.a, you add it to the command line like so:
cc ... -lXXX

where the letter after the minus is a small L. But all this is not
really a feature of the language, it's a feature of the OS and your
compiler. Please direct your further inquiries to the newsgroup
dedicated to your platform.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jun 27 '08 #2
On Jun 10, 2:24 pm, Victor Bazarov <v.Abaza...@comAcast.netwrote:
Giuseppe.G. wrote:
Hi what are .a files used for? Are they a kind of archive to
hold libraries? I've installed a toolkit that puts some .h
files into /usr/ local/src and a .a file into
/usr/local/lib. However, I don't know how to instruct the
compiler to use the contents of the .a file, if it's really
needed and for what.
.a files in Unix are "archives" of object modules.
Or of anything else. They're files created by the "ar" utility,
and can be used to archive anything. (In the old days, you had
to run ranlib on the output of ar before the linker could use
it. ranlib created an additional index file, and then inserted
it at the start. I think this has pretty much disappeared.)

I've often wondered, in fact, why compilers didn't treat a
request for the library as part of the include path, so that you
could add your headers to the library as well, and thus package
the library as a single file.
They are basically
an equivalent of .lib files on Windows (if you're more familiar with
that environment). A .a file is used by the linker; if the name of the
file you need to add is libXXX.a, you add it to the command line like so:
cc ... -lXXX
That's one way, and it also causes the compiler to look for the
library in a number of specified places (much along the lines of
how it looks for a header file). You can also specify the
pathname directly.
where the letter after the minus is a small L. But all this
is not really a feature of the language, it's a feature of the
OS and your compiler. Please direct your further inquiries to
the newsgroup dedicated to your platform.
I agree that it's platform specific, but I'm not sure I'd call
it a feature:-).

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Gyger | last post by:
Hello, Three weeks ago, I have started to develop a binding extension for Qt and PHP 5. Now, I can display a dialog box containing some widgets like label, buttons and edit line. I have just...
0
by: Boris Boutillier | last post by:
Hi all, I've got problems with the Py_TPFLAGS_HEAPTYPE and the new 'hackcheck' in python 2.3. I'm writing a C-extension module for python 2.3. I need to declare a new class, MyClass. For...
5
by: Jeffry van de Vuurst | last post by:
Hi, I'm working on an xml schema and I'm running into some problems relating substitutionGroups and extensions. This xsd validates fine: There are three elements and three complex types and...
1
by: Brian Henry | last post by:
Just thought maybe someone here would like to know this. It's an example code I just created quickly on how to figure out the name of a type of file based on its extension (say for example .DOC)...
4
by: Wade | last post by:
11182005 2023 GMT-5 Im doing a totorial and Im getting a great deal of errors but being so new, I do not understand what they mean: Error: uncaught exception: " nsresult: "0x80570009...
24
by: krishna | last post by:
Hi all, char a; will declare character array of size 10 starting with the index 0. what is the meaning of the following declaration? what is the purpose of such declarations? char a; ...
3
by: nimmiejoey | last post by:
Hello everybody, could you please tell me the meaning of the command outport(LPT1,00)
87
by: Robert Seacord | last post by:
The SEI has published CMU/SEI-2006-TR-006 "Specifications for Managed Strings" and released a "proof-of-concept" implementation of the managed string library. The specification, source code for...
0
by: robert | last post by:
Hi all, I'm having a hard time resolving a namespace issue in my wsdl. Here's an element that explains my question, with the full wsdl below: <definitions name="MaragatoService"...
6
by: tommybiegs | last post by:
I'm having a weird problem. I can't seem to force php to load an extension using php.ini, but it loads perfectly if I use dl() at the beginning of a test script. In php.ini I've got: ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.