problem with multiple LLVM passes

I'm trying to write two LLVM passes, one of which uses the results of the
other. The first is LiveVars and the second is RemoveUseless. In the
RemoveUseless class I have:
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {

This compiles fine, but when I try to run it I get an error:
       Pass class not registered!

The error goes away if I take out that "addRequired".

The code for the LiveVars pass includes
   RegisterPass<LiveVars> X("liveVars", "Live vars analysis", true,

and I can run the LiveVars pass like this:
   opt -load Debug/lib/ -f -analyze -liveVars ...

I've tried running the RemoveUseless pass with various combinations of flags (just -removeUseless, both -liveVars and -removeUseles, with and without -analyze), but I always get the same error.

Any help will be much appreciated!