lucacerone
lucacerone

Reputation: 10109

Where to save my C++ libraries? (Ubuntu)

I am not sure this strictly a programming question, so I apologize if it is not.

I developed a few libraries in C++ that I mean to use in several different projects. Till now I kept copying the updated library in the folders of the various projects. As you can imagine this is not ideal, so I would like to create a "3rd-parties" folder where I save the libraries I write and other that I might download in the future.

How can I do this? And considering I'll want to share/release my code later on what is the best strategy to be sure that the used libraries are included in the code I deploy?

Upvotes: 4

Views: 3395

Answers (2)

paulsm4
paulsm4

Reputation: 121599

There are no hard and fast rules. But if these are 1) general-purpose, for 2) global sharing, then I'd suggest /usr/local/lib (for your .a and .so libraries) and /usr/local/include (for the corresponding headers).

Here's a good description of "standard file locations" for Linux:

Upvotes: 6

perilbrain
perilbrain

Reputation: 8187

If you want to share your modules with new project its better to organise them in a single folder and mark this folder as included library path in your new projects.

Upvotes: 2

Related Questions