# Moderncv - undefined control sequence in minimal document

Attempting to compile the following minimal working example fails on my TeX installation.

\documentclass{moderncv}
%\moderncvstyle{banking}

\begin{document}
Foo
\end{document}


The log file repeats the following error eight times:

! Undefined control sequence.
<argument> \@firstname
{}~\@lastname {}
l.6 \begin{document}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., \hobx'), type I' and the correct
spelling (e.g., I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.


The error remains the same whether I'm using pdflatex or luatex to compile. I'm using a fresh (full) TeX Live 2016 installation and tlmgr revision 41476 in Linux Mint and I'm using TeXstudio as my editor. According to tlmgr update --all and tlmgr update --self my installation is up to date.

Uncommenting the style statement results in an additional warning:

LaTeX Warning: You have requested package moderncvheadiii',
but the package provides moderncvheadiii'.


I found a few mentions of this online, but it seems this issue was fixed by a moderncv update (https://github.com/xdanaux/moderncv/issues/1).

Peculiarly, I can update and re-compile an older moderncv document (that was made on another distribution) without any issues. Other document classes also seem to work correctly.

How would I go about troubleshooting an issue like this?

EDIT

Thank you @Elad Den for pointing out that I need to define names in the document's preamble. Both \name{}{} and \firstname{} \familyname{} work, although my editor does not recognise the former command. This does indeed allow me to compile without any issues.

Unfortunately it wasn't smooth sailing from here on out. Adding \recipients{}, \opening{}, \closing{} and \makeletterclosing work fine, but adding \makelettertitle results in the following errors:

Undefined control sequence. \makelettertitle
You have requested package moderncvheadiii', but the package provides moderncvheadiii'.
You have requested package moderncvbodyiii', but the package provides moderncvbodyiii'.


Remarkably, I do receive a (seemingly) correct pdf output, despite the mess of errors and warnings in my log file.

I've found one reference to a similar issue, but no solutions were offered in this thread: Problem with moderncv or TexStudio: makelettertitle is undefined

It seems like (since this is a CV) the documentclass is expecting \firstname{} and \familyname{} to be defined. You could add those lines to the preamble or use the \name{}{} command

\documentclass{moderncv}
%\moderncvstyle{banking}

%\firstname{}
%\familyname{}

\name{}{}

\begin{document}
Foo
\end{document}
`
• Thank you, that seems to have solved the issue for this minimal document! However, I'm afraid I immediately run into more issues when I use the \makelettertitle command: "Undefined control sequence. \makelettertitle". At least one person has run into this issue before, but it's unclear whether he managed to solve it or not: tex.stackexchange.com/questions/304421/… – Zenit May 17 '17 at 13:04
• It seems his problem was solved by updating texlive. If I were you I'd try that, and if the problem persists, come back to TeX.SX and ask another question :) – Elad Den May 17 '17 at 14:24