LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 08-04-2007, 05:35 AM   #1
NichA
LQ Newbie
 
Registered: Jul 2007
Posts: 4

Rep: Reputation: 0
How do I install a shared library?


I just installed Slackware 12.0 on my laptop but during the installation process there was an error while installing 3 library files. I continued the installation hoping I wouldn't need the library files it had trouble with, but afterwards when I tried to start up xfce it couldn't do it because it said it was missing a library.

So... I re-downloaded the files that didn't get installed from the "l" package and I want to now how to install them on my system. I noticed that the files I need are .tgz files so can I just copy the files to the /lib directory and run a tar command on them?
 
Old 08-04-2007, 06:04 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
For Slackware packages, you use "installpkg filename.tgz". Also run "ldconfig" afterwards (I'm not sure this is strictly necessary, but it doesn't hurt).
 
Old 08-04-2007, 07:30 PM   #3
markmlinux
LQ Newbie
 
Registered: Jun 2007
Location: San Diego
Distribution: Slackware 11.0
Posts: 13

Rep: Reputation: 0
Compiling Librarys - different method

Quote:
Originally Posted by Nylex
For Slackware packages, you use "installpkg filename.tgz". Also run "ldconfig" afterwards (I'm not sure this is strictly necessary, but it doesn't hurt).
Probably as the post before this said you would better off with SlackPackage, but you could also compile the source.

I move the tar.gz / tar.bz2 / .tgz package to /usr
I then with mc untar the package with F2 drop down menu
there are two selectioins I usually use the upper selection
of uncompressing the tar ball
then change to the directory under /usr/ex-prog2-1.3.4/

I write a shell batch file and copy it after it works to a
install dir say /home/install or whatever

Generally the procedure most times is:
cd /usr/ex-prog2-1.3.4/
make clean (if compiles before - and won't hurt if it wasn't)
# ./bootstrap
# ./autogen
./configure
make
make check
make test
make install

this is it most times, however sometimes it doesn't work and I have to add ./bootstrap before ./configure

then there is ./autogen problems

and then also python install programs are different.
generally there is a INSTALL file in the directory giving the instructions.

And getting to the crux of the problem
to get shared librarys when not configured as the default (usually)

./configure --enable-shared --enable-static
also I have been adding --enable-gnu-ld , and hasn't hurt yet.

How do you know what is the default and what other options are available (think xmms plugins)?

type ./configure --help | more
review all the available options, sometimes you might get a idea to turn off options --disable-xxx

sometimes to get a library to compile right you need to
specify paths to libraries. --prefix=/usr/lib or such

I beleive you can specify
./configure --enable-shared & --enable-static at the same time.

Rule of thumb - most times you want 'shared'

and the make check and make test probably could be left out, I do it anyway and watch what scrolls by. If make check, for example isn't valid - all you get is a little error (that can be ignored)
 
  


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
list library function of a shared library .so powah Linux - General 7 10-25-2011 05:47 AM
Making a static library from a given shared library vro Programming 1 07-27-2007 05:07 PM
shared library sidharth.nitj Programming 2 06-12-2007 09:41 AM
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 02:53 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