LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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!

Notices


Reply
  Search this Thread
Old 03-26-2010, 02:36 PM   #1
DoDo1975
LQ Newbie
 
Registered: Nov 2006
Posts: 17

Rep: Reputation: 0
Turn a .o Shared Library into a .so


Hi,

I compiled a .o library and I want to make it a shared .so library. Is there a way I can do this? I have a file that I compiled rlm_wimax.o, but the program I am using is looking for a .so file. I suspect somehow I have to link them shared, but not sure how.

Please help!

Thanks,
 
Old 03-26-2010, 03:55 PM   #2
irmin
Member
 
Registered: Jan 2010
Location: the universe
Distribution: Slackware (modified), Slackware64 (modified), openSuSE (modified)
Posts: 342

Rep: Reputation: 62
You will need to compile the object file with "-fPIC" to create position independent code. Then the object file can be created into a shared library either with "gcc -shared -o yourfile.so <objectfiles>" or "ld -shared -o yourfile.so <objectfiles>".
 
  


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
shared library : libfg.so: cannot open shared object file error 40 x_gaurav Programming 2 06-28-2009 07:29 AM
ldd reports shared library missing, but library exists on disk athv_gr Linux - Newbie 7 05-13-2009 01:31 PM
gcc link shared library against another shared library qcp Linux - Newbie 1 07-25-2008 12:15 PM
LINUX - linking archive (static library) with shared (dynamic) library gurkama Programming 5 03-05-2007 12:11 AM
howto compile bin with my library using all-static and shared linked standart library stpg Programming 4 06-29-2004 05:20 AM


All times are GMT -5. The time now is 07:01 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration