I’m trying to generate spotify playlists (not text-based) and found this on Github: https://github.com/liesen/spotify-api-server
I have no experience in C programming so i don’t really know where to start. Are there any relevant tutorials/articles on setting up a c-server similar to the one i’m trying to set up? on a pretty basic level.
I have a sneaking suspicion that building and using this C program isn’t actually what you want (http://developer.spotify.com/en/spotify-apps-api/overview/ might be easier for you to get started with), but I’m going to help you anyway.
Most C projects have a README file that tells you how to build them. In this case, it says:
Make sure you have the required libraries
libsvn-dev) and its dependency,libaprUpdate
account.cwith your credentials. A Spotify premium account is necessary.Copy
appkey.cinto the directory and runmake.There are a few extra things that the README doesn’t say, that an experienced developer will be able to guess at:
libsvn-dev and libapr are the names of Ubuntu packages (I think), so it is probably expecting your development machine to be running Ubuntu. You should probably install build-essentials as well (on a new machine, I would usually run
apt-get install ${*-dev-packagages}and thenapt-get build-dep ${*-dev-packages}.build-depmight download some packages that you don’t need, but bandwidth is cheap, and debugging missing packages is a pain in the ass.when it says libspotify > 9 it normally means “greater than 9 but less than 10” (if the first number in a C-library version number changes, it normally means “BEWARE: we broke things.”). If you get build errors about wrong number of arguments to functions, this is probably why.
It says “run
make” so there will be a file calledMakefilesomewhere. You need tocdinto the directory that containsMakefilebefore typingmakemakewill probably produce an executable file somewhere. I usually find these by runninglsand looking for items highlighted in green. If I can’t find anything that way, I will read Makefile and note that “all” depends on “server” so I would look for an executable called “server”.You are jumping in at the deep end here (building someone else’s experimental package as your first C program). If you get errors that you don’t understand, it’s not because you’re stupid: it’s because C is a brutal and archaic language, and it wasn’t designed as a teaching language like Python was, or a beginner-friendly language like Javascript. Once you get used to it, you start to see steamtrain-like beauty of the language; the pain subsides to a dull ache, but it never truly goes away.