Error: \Undefined control sequence \setmainfont in Ubuntu 12.04

The initial version of the question was misleading as it identified that there was an undefined command error but did not show which command was undefined. The error is

! Undefined control sequence.
\zf@set@font@type ...onttype \zf@basefont \zf@tfm 
                                                  \or \zf@atsuitrue \ifnum \...
l.5 \setmainfont{Code2000}

So the undefined command is \zf@tfm.

However this error is essentially a spurious internal failure caused by not stopping at the first error. (TeX's recovery actions when you scroll past an error are often not particularly useful and just lead to lots of spurious errors).

The first error reported is

! Font \zf@basefont=Code2000 at 10.0pt not loadable: Metric (TFM) file or insta
lled font not found.
\zf@fontspec ...ntname \zf@suffix " at \f@size pt 
                                                  \unless \ifzf@icu \zf@set@...
l.5 \setmainfont{Code2000}

which means that it can not find the Code2000 font either because it is not installed where Tex expects, or not installed at all.