# Bad references with \cref in Ubuntu [closed]

I've a problem with the references generated with \cref in Ubuntu. When I try to cite some figure or table I obtain ?? [table][1][1]1.1, with no link to go to the figure or table. In the table of this example I use the label: \label{tab:p2PutKey}, and when I want to reference it I use \cref{tab:p2PutKey}.

But the code and the packages that I use are correct, because when my teacher compiles the same code in Windows, it works perfectly, so there is a conflict with linux. I need to install any specific package?

A minimal example that produces the error:

\documentclass{memoir}
\usepackage[spanish]{cleveref}
\usepackage[justification=centering]{caption}

\begin{document}

Here's the table that I want to reference:

\begin{table}[!hbt]

\begin{tabular}{|c|c|}
\hline
Row 1 & Row 2\\
\hline
\end{tabular}
\caption{Example of a table}
\label{tab:example}
\end{table}

In the \cref{tab:example}, we can see\dots

\end{document}


The result I obtain is:

-
Did you compiled twice? – Claudio Fiandrino Jan 18 at 9:36
Please give a minimal working example (MWE) demonstrating the problem. The loading order of packages relative to cleveref is rather critical - see the documentation of cleveref. – Andrew Swann Jan 18 at 9:51
Works for me: Ubuntu 12.10, pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/Debian), LaTeX2e <2011/06/27>, Babel <v3.8m>, memoir 2011/03/06 v3.6j. – Benjamin McKay Jan 18 at 10:24
Debian (except unstable) and Ubuntu still contain TeX Live 2009. Many packages have been significantly improved since then. I would recommend installing TeX Live directly from TUG instead of using the Debian packages. That way you can always get current package versions by running sudo tlmgr update --all. – Benedikt Bauer Jan 18 at 10:39
To update your version you could have a look to How to install “vanilla” TeXLive on Debian or Ubuntu?; there's also an article: just replace the year 2010. – Claudio Fiandrino Jan 18 at 10:40