Visit the LQ Articles and Editorials section
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 09-22-2009, 07:57 AM   #1
Registered: Jun 2009
Location: Brighton, UK
Posts: 49

Rep: Reputation: 16
linking to shared libraries then using - where to store?

I compile a load of shared libraries, and currently place them in my /libs/linux build path, as on windows the .libs go into /libs/win32.

But on linux these are the binary run times as well, whereas on windows, it creates .dll's for the run time, which of course go into /bin/win32.

a) Whats the best solution for my linux paths? Place them only into /bin and add that path to the linker options (seems odd!).
b) Duplicate/copy them in both the /libs and /bin (waste of disc!)
Old 09-22-2009, 09:15 AM   #2
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,222
Blog Entries: 9

Rep: Reputation: 835Reputation: 835Reputation: 835Reputation: 835Reputation: 835Reputation: 835Reputation: 835
"best" is subjective.

"usual" is to put the stuff you create in /usr/local. You can make a /usr/local/bin and a /usr/local/lib or make something like /usr/local/mystuff/bin and /usr/local/mystuff/lib. Many add on packages build a subdirectory under /usr/local then put their lib, bin, man etc... under that subdirectory.

You can add the executables directory to your PATH variable in /etc/bashrc (if using bash). You could also create links in /usr/lib to the stuff you build under /usr/local so it finds the libraries in default location but you'd have a link letting you know where the libraries really are.


dll, lib, link, object, shared

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
Linking to Shared Libraries with g++ random0 Programming 1 06-15-2006 10:12 PM
any links on linking, loading shared libraries, shared objects. etc? ananthbv Programming 0 02-03-2005 07:47 AM
Shared libraries and linking., devin Programming 3 04-08-2003 03:18 PM
Linking to shared libraries? Griffon26 Programming 1 10-20-2001 05:29 PM
linking with shared libraries kobilevi Programming 0 03-01-2001 10:09 AM

All times are GMT -5. The time now is 11:32 PM.

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