7
2
I have to admit that I feel completely lost each time I have to fulfill the dependencies of some C or C++ code. Currently, I'm on Ubuntu 9.10 (Karmic Koala), but I remember the same feeling of forlornness from Windows.
I really think that I do understand C, C++, static and dynamic libraries, header files and linking, as well as the packet manager "aptitude", but when it comes to the practical part, I have absolutely no idea what to do. Even if I manage it somehow, I don't really know how I got there and learn nothing from it.
For example, today I wanted to use code which states that "It uses glib2, curl and openssl". In the end, I figured out that curl
and openssl
were already installed, but I needed to install libcurl3-dev
via my packet manager, which will also required (and installed) libcurl4-openssl-dev
so that I didn't have to worry about OpenSSL. But I had to choose these packet names from 67 similar-sounding alternatives. And glib
, on the other hand, had to be downloaded and built manually since there was no matching packet at all.
It took my several hours to find this out, and it's not the first time. So my question really is:
When I have a vague description of the dependencies:
- How do I find out which of those are already installed?
- How do I figure out which of those can be fulfilled by installing packages?
- How do I know the exact names of those packages?
- If a package has to be built from source, how do I ensure that I don't get lost in the endless dependencies of this source, and the dependencies of those dependencies...?
- I think I also need to link the libraries with my object files. If a single packet comes with several static library files, how do I know (without trial and error) which one to link?
This site is about programming, not sorrow. How about a more concise description of a concrete problem? – bmargulies – 2010-02-03T03:07:42.937
2My initial feeling was that this was a marginal programming question but the more I thought about it I think it is useful. It is a frustration for many developers - who hasn't been shoved down the rabbit hole and spent an entire morning compiling 12 dependencies? I think the question has a wider audience than most want to admit. – Duck – 2010-02-03T03:37:38.497
This reads as a "How do I use the package manager?" question to me, and thus Super User fodder. OTOH I can see "How do I run down and install dependencies by hand?" as being more appropriate for SO, because in the absence of good documentation for each and every thing you have to get, you end up reading
./configure
andmake
output looking for the relevant error message in the torrent... – dmckee --- ex-moderator kitten – 2010-02-03T04:41:56.633the development package for the glib2 library is called, believe it or not, libglib2.0-dev – user23307 – 2010-02-03T04:59:45.437
@justin: Thanks. I searched http://packages.debian.org for "glib" and this yielded no useful result. I didn't realize that I had to search for "glib2", and then I get "glib2.0dev"
– Lena Schimmel – 2010-02-04T18:45:26.120About the migration to SuperUser: I'm not completely sure about the border between Stackoverflow and SuperUser, but this question IS programming related. I know how to use a package manager, but I asked how to use it to resolve the packages needed for PROGRAMMING. The distinction between installing the package "curl" and "libcurl4-openssl-dev" is exactly the difference between a user and a programmer, and this is what the question was all about. (Sorry for using capitals, but since I don't have itallics or bold in comments, I had to). I think a non-programming user will not benefit from this. – Lena Schimmel – 2010-02-04T18:49:47.903
@bmargulies: Yeah, it's generally a bad I idea to write a stackoverflow question when in a bad mood, and I should have made some more effort to make the question more concise. But anyway, it is a "key feature" of this question not to be too specific. You see, I don't want to know what the package name for the curl developement package is, since I already figured out that it is "libcurl3-dev". Instead, I'm asking, what is the general way to find this out, so I know what to do the next time this problem arises. – Lena Schimmel – 2010-02-04T18:54:22.090