  A cohomology theory, associated to a $n$-Lie algebra and a representation
space of it, is introduced. It is observed that this cohomology theory is
qualified to encode the generalized derivation extensions, and that it
coincides, for $n=3$, with the known cohomology of $n$-Lie algebras. The
abelian extensions and infinitesimal deformations of $n$-Lie algebras, on the
other hand, are shown to be characterized by the usual cohomology of $n$-Lie
algebras. Furthermore, the Hochschild-Serre spectral sequence of the Lie
algebra cohomology is upgraded to the level of $n$-Lie algebras, and is applied
to the cohomology of generalized derivation extensions.
