library files type

Posted on 2006-05-02
Medium Priority
Last Modified: 2012-05-05
 I thought I know all the file types, but I am not sure.  What are the following files, and who generates them?


   Am I missing any?

Question by:jmccay
LVL 15

Assisted Solution

m1tk4 earned 900 total points
ID: 16592293
.so = shared object, equivalent to Windows .dll

.lai  are static binary files generated during compile process and sometimes shipped in RPMs as well in -devel packages to let you build static executables using the libraries. Thing .obj in windows terms.
LVL 35

Assisted Solution

by:Duncan Roe
Duncan Roe earned 900 total points
ID: 16594656
.a is a static library indeed.
.la is  a libtool library file (i.e. a script) possibly required by loaders at run or compile time. The header comments advise against deleting it anyway.
.lai is similar (libtool library file ...)
Some .so files are also scripts - see for example /usr/lib/libc.so

Author Comment

ID: 16601565
Is there a way to convert a .a (or .la or .lai) into a .so?

This is sort of in the wrong forum, but it is along the same lines.

   What is a dll.a file?  I know what a dll is, but a dll.a?  (mingw compiler)

Also, can you point me somewhere where this information can be found on the net?
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

LVL 15

Expert Comment

ID: 16601638
>>Is there a way to convert a .a (or .la or .lai) into a .so?

Yes of course, this is done by linking, just like you use a linker in Windows to convert .OBJ to .DLL, .EXE or .COM. It's not a manual process though, typically the makefile of the software you are building should take care of that.
LVL 35

Expert Comment

by:Duncan Roe
ID: 16604087
A conversion of .a to .so can often fail, e.g. if the .a lib wasn't compiled with -fPIC as required for code in a .so (but not in a .a).
Information on the net? Dunno. Would be an interesting site if someone can find it...
LVL 27

Accepted Solution

Nopius earned 200 total points
ID: 16612755
Try following method:

1) Decompose your .a archive (suppose it named old_static.a):

1.1) List files
files=`ar -t old_static.a`
# you will get a list of object files in that archive

1.2) Extract all files:
ar x old_static.a  $files
# you will get a lot of .o files in current directory

1.3) Check if all files are rellocatable:
file *.o | grep -v relocatable
# output should be empty

2) Compose all .o files into shared library, try this:
gcc -shared new_shared.so $files

3) If 2) is OK. Check if result file is shared library:
file new_shared.so

You may or may not have success with this method, please check and see if it works.


Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

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

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Loops Section Overview
Suggested Courses

809 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