When I first learned VHDL, I bumped in to quite a few language quirks. Here is one thing that I learned the hard way: the scope of VHDL use clauses.
I figured out that you can put several entities or packagas in the same file. Now, usually people only put design units in the same file in pairs, like entity + architecture or package + package body.:
library
use
entity
architecture
or
library
use
package
package body
Note that the use clauses and library clauses are only written once at the top of the VHDL file.