R..
How much water were you drinking? Usually for me, this happens when I need to drink more. If I get the pounding headache, drinking gatorade usually helps. :)
I am willing to bet that is what the issue is after reading your addition... Caffine is a dehydrator, so that would make it even worse. Especially eating only cheese! LOL! I would reccomend that before you exercise, drink a glass of water (Smart water is really good... tastes like regular water, but has electrolytes added to help keep you hydrated.) Take water with you during your exercise, and afterward drink another glass along with a protien... even if it is just a protien bar. It may feel like you are undoing your work, but the protien is needed to allow your body to build muscle (which will replace fat...)
Good luck!!! :)