compile with bufClass