I think I figured it out. I got everything working in a browser compiler (OnlineDGB) and copied the working headers over to the Commodore for partial success.

I haven't figured out when to use "extern". In OnlineDGB and on the Comodore 128 the program works fine with or without extern. But without extern, the Commodore 64 throws a lot of errors--and with extern it still runs out of memory! Oh well, it was worth a try. (There are always other solutions like cross-compilers for Windows)

Thanks for your help, it really helped me to get a grasp on headers.