A wrong lag/lead of a variable in VarOrdering

Could someone please tell me where I should check when this message popped up when I run dynare++?

Caught ogu::Exception: dynamic_atoms.cpp:470: A wrong lag/lead of a variable in VarOrdering::do_pbspbfb

I’ve checked my codes many times but still cannot find out what’s wrong. Is it telling there is mistake in basic syntax, or the model?

Thanks a lot for your time and effort.

please post your code

@arks the error “A wrong lag/lead of a variable in VarOrdering” likely means that you declared more variables than you have equations. to be sure, first try counting the number of endogenous model variables and compare to the number of model equations. assuming you find more declared variables than equations, you will need to remove the endogenous variables that are never referenced in your model equations. I just ran into the same error in my own code and it turned out I had 90 variables and 89 equations. once I found the extra variable, the error stopped.