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, 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 utilizes glib2, curl and openssl". In the end, I figured out that
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?
By the way, my first draft of this question was much too long, so I decided to rewrite it. If you like to get a deeper impression of my sorrow, you can read the original one here.