In reply to uvm_novice:
That would certainly be the universal and least ambiguous way of making your test work.
There are different compilation strategies amongst tools, and even different strategies within the same tool for dealing with packages that have previously been compiled, but never referenced. Similar strategies exist for module that have been compiled, but never instantiated. You don't want the overhead of code included in your simulation if it was never intended to be used.