linking to shared libraries then using - where to store?
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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!)
"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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.