How does Xilinx ISE determine compilation order?
It sounds like you figured out your problem, but you can indeed set a custom compilation order in ISE. For example, see this link: Setting a Custom Compilation Order (part of ISE help).