LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-28-2012, 04:24 AM   #1
tramni1980
Member
 
Registered: Jul 2006
Location: Köln, Germany
Distribution: Slackware64-14.2 & -current, DragonFly BSD, OpenBSD
Posts: 819

Rep: Reputation: 55
static-shared libraries frustration


Hello,
I am using Slackware64-13.37. Recently I had a number of issues compiling software, all of which turned out to to be a result of that the dependencies are built only as shared libraries, while the application being compiled only needs static libraries. As I am not a programmer, please excuse my ignorance, but I would like to ask, is there a way (probably a general) to tell an application that is being compiled to search for shared libraries only?
 
Old 04-28-2012, 04:53 AM   #2
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 875

Rep: Reputation: 282Reputation: 282Reputation: 282
If your referring to your program grads (that was it?) that you ended up with a special package to cover it's dependencies then the dependencies and the application were probably setup to be statically linked by default as you then don't need to package the dependencies to enable the program to work.

This is similar to how Eric (AlienBob) packages his vlc build as it means he distributes one package instead of about 20 (number 20 pulled out of thin air).

Typically when compiling libraries you have the option of --disable-static & --enable-shared to tell configure what you want (you can have both if you want or only one)

When you compile your application it may also have options to enable the libraries to be linked either way but they must exist in the correct form to be used in a particular way.

In Slackware most libraries are configured with --disable-static --enable-shared so there is no option for applications to be statically linked against them.
 
Old 04-28-2012, 06:42 AM   #3
tramni1980
Member
 
Registered: Jul 2006
Location: Köln, Germany
Distribution: Slackware64-14.2 & -current, DragonFly BSD, OpenBSD
Posts: 819

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by wildwizard View Post
When you compile your application it may also have options to enable the libraries to be linked either way but they must exist in the correct form to be used in a particular way.
Thank You very much for Your reply. This is exactly what interests me, as I am using Slackware that only ships shared libraries, is it possible to tell
an application I am compiling to look for shared instead of static libraries for its dependencies. How could I recognise that an application has an option to
be configured to use shared libraries? --enable-shared and --enable-static refer to whether to produce the respective libraries for the current package, but
which parameters usually tell the application to look for shared or static dependencies?
 
Old 04-28-2012, 07:37 PM   #4
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 875

Rep: Reputation: 282Reputation: 282Reputation: 282
if you issue "configure --help" it will output supported switches for that program/library, sometimes you may need to pipe it through less "configure --help | less" (this is usually larger projects)
 
  


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
GCC/G++ with shared and static libraries catallergy Linux - Software 1 03-16-2010 09:48 PM
Static libraries vs shared Libraries catallergy Linux - Newbie 2 03-16-2010 01:30 PM
Forcing static linking of shared libraries raghu_rao Linux - Newbie 8 01-14-2009 07:34 AM
Static variable sharing in shared libraries ristiisa Programming 13 10-20-2006 09:08 AM
compiling with shared and static libraries jinksys Programming 1 11-22-2003 04:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:27 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