I know that you need to rerun latex to resolve references -- it doesn't matter how many times I rerun it -- I get the same warning messages.
This sample program:
\documentclass[12pt]{article}
\begin{document}
\label{pg:first}
\newpage
Pages \pageref{pg:first} through \pageref{pg:last}.
\newpage
\label{pg:last}
\end{document}
yields:
Pages 1 through ??.
and the warnings:
LaTeX Warning: Reference `pg:last' on page 1 undefined on input line 6.
LaTeX Warning: There were undefined references.
on every run.
A .aux file is generated, but consists only of "/relax". Running under sudo has no effect.
Am I just missing something basic in this example? A more complex one used to work in MikTex.
\labelto some object (section, figure, table, footnote, whatever) in order to "know" what to do with it. However, your MWE is so minimal that there's literally nothing for LaTeX to attach the second label to. Try providing some "real" item before issuing the second\labelcommand, and you should be OK. – Mico Jul 26 '12 at 08:16\nullafter the\newpage, and it works. – Torbjørn T. Jul 26 '12 at 08:18