LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-19-2006, 08:48 PM   #1
afx2029
LQ Newbie
 
Registered: Sep 2005
Posts: 3

Rep: Reputation: 0
Convert static library (Filename.a) to dynamic shared object (filename.so)


I have this problem where an application (Xgl) complains it can't find two librairies, libXau.so and libXdmcp.so. I don't have these X related files on my system, but have the static libXau.a and libXdmcp.a files in my /usr/X11/lib directory. I already a similiar problem, but using a rarer library (where I couldn't find the .so files on the net), so I simply ran a few (cryptic?!?!) commands to generate .so file(s) from the library archive. anyone know where I can get information on this? Also, anybody know if the .a file is a collection of .o files, or if .a files are the same as .o files, and are only in a different format, using for static linking with an application?

Thanks in advance!
 
Old 07-19-2006, 10:43 PM   #2
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: SlackWare > Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy .. bullseye bookworm
Posts: 1,834

Rep: Reputation: 108Reputation: 108
http://packages.debian.org/testing/libs/libxau6
http://packages.debian.org/testing/libs/libxdmcp6

These pages have debian packages and links to tarball.
 
Old 07-20-2006, 08:53 AM   #3
afx2029
LQ Newbie
 
Registered: Sep 2005
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks for the reply....I'll try getting it to work by downloading the actual files. I was hoping someone would know how to do what I was talking about, but I guess I might as well get down to what I am really trying to do (install XGL and Compiz), I'll probably run across many other problems along the way.
Thanks a lot!
 
Old 03-05-2007, 12:23 AM   #4
negiliblek
LQ Newbie
 
Registered: Jan 2006
Posts: 2

Rep: Reputation: 0
Here's where I started:
http://tldp.org/HOWTO/Program-Librar...libraries.html

..here's another site which gave more color to the subject:

homes.esat.kuleuven.be/~gcc/shared_libraries.html

-to answer one of your questions directly: a .a file is a collection of .o files in archive file format. this archived collection of .o files is used for static linking with applications. So no, .o files aren't the same as .a files.



Quote:
Originally Posted by afx2029
I have this problem where an application (Xgl) complains it can't find two librairies, libXau.so and libXdmcp.so. I don't have these X related files on my system, but have the static libXau.a and libXdmcp.a files in my /usr/X11/lib directory. I already a similiar problem, but using a rarer library (where I couldn't find the .so files on the net), so I simply ran a few (cryptic?!?!) commands to generate .so file(s) from the library archive. anyone know where I can get information on this? Also, anybody know if the .a file is a collection of .o files, or if .a files are the same as .o files, and are only in a different format, using for static linking with an application?

Thanks in advance!
 
Old 08-17-2007, 07:07 AM   #5
pokemaster
Member
 
Registered: Apr 2005
Location: Massachusetts, USA
Distribution: debian,ubuntu,slackware
Posts: 110

Rep: Reputation: 17
I'd never run into this until today, when spice3 needed libtermcap

So I downloaded, built, and installed termcap, only to discover that it only installed the static libs, libtermcap.a

Fortunately after reading this post, I remembered something... static libs are ar archives. So here's what I tried (and it worked first time):
Code:
ar -x libtermcap.a
gcc -shared *.o -o libtermcap.so.2
Then copied the new file to /usr/lib and voila
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
extracting a library file named filename.1.2.... Tavassoli Linux - Software 1 06-15-2006 08:29 AM
Shared object library that uses another shared object library Nightfox Programming 1 02-15-2006 11:00 PM
change uploaded files from filename.avi to filename.avi.html like www.rapidshare.de latheesan Linux - Newbie 3 06-16-2005 05:33 AM
howto compile bin with my library using all-static and shared linked standart library stpg Programming 4 06-29-2004 05:20 AM
shared object library won't load (libstdc++) sleepylight Linux - General 4 04-27-2004 05:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration