well - there isn’t a general rule about how to do it, but there are some strategies:
a) stick with modern libraries, or code that you don’t have to rip out from a larger codebase. There is alot of code out there, some of it is easier or much better documented then others, and it makes a big difference in compiling.
b) try to find example projects that use that library that might be helpful as a reference.
c) look for code that looks actively maintained. If it’s on sourceforge, for example, is the forum active? Have there been changes in the last year?
d) When you compile, start with just trying to compile the lib itself as a lib. What kind of errors come up? You can likely find many of the needed .h files (for compile errors) or .lib files (for link errors) just by googling. It’s amazing, but adding the right include, can make a project go from 500+ errors to something something more manageable.
As you start to dabble around, you will get used to various code styles, from the old-school (ie, numerical recipies type code) to the new school (templates, etc), the way the libraries work (ie, callback, interfaces, etc) and from there you might have better luck picking code to try.
I would like to make a short tutorial about this, when I have a second, because it might be helpful to just look at a case study, and what goes into getting libraries to work. I haven’t done it before (taken notes) about the process, but it seems like it might be helpful. I’ll try to do that in the future.
In the meantime, if you want to email me off-line, or do it online - it might be nice to see the kinds of errors you have and if it’s possible to work through them…