These foods can be made the previous night and refrigerated or frozen. They can be kept cold during the hike by packing them along with frozen box drinks. The drinks will thaw out and you will have a nice chilled drink to refresh yourself with.
Alternately, you could take along non-perishable foods like nuts and crackers. Make sure you carry sufficient water, but if you run out of it, purify the water from streams or lakes by boiling or using purification tablets.
For a long hike, you will need to put some thought into planning your meals. While you can pack the foods suggested earlier for the first day, you will need to carry foods with a longer shelf life for the subsequent days.