• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 453
  • Last Modified:

library files type

 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?

3 Solutions
.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.
Duncan RoeSoftware DeveloperCommented:
.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
jmccayAuthor Commented:
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?
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

>>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.
Duncan RoeSoftware DeveloperCommented:
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...
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now