When I pop up the sketch-import library tab, and click on the relevant libraries, it adds the same include lines that I've already got there. (I'm sorry, I can't post my code) I've compiled an example program with the subroutines at the end of the program and that worked fine, so it's not my IDE settings.