Error with pstree

\documentclass{article}
\usepackage{graphics,graphicx}
\usepackage{pstricks,pst-node,pst-tree}
\begin{document}
\pstree[levelsep=35pt]{\Tcircle{10}}
{
\Tcircle{11} \Tcircle{21}
}
\end{document}


Why the error:

! Undefined control sequence. \c@lor@to@ps l.5 \pstree[levelsep=35pt]{\Tcircle{10}} ?

I compile with latexmk if that makes any difference:

• @ptrcao: I don't get any error. Please, add \listfiles in front of the code and show the output of this command that you easily find in the .log file. – egreg May 25 '11 at 10:16
• @ptrcao --- Jasper Loy is correct, the problem is caused by using pdflatex, which does not work with pstricks. Try using latexmk -pdfdvi in place of latexmk. – Ian Thompson May 25 '11 at 14:48
• @Jasper --- the manual says it uses dvipdf by default, and I think that uses ghostscript and dvips. It works fine on my system, but maybe -pdfps is a safer option. – Ian Thompson May 25 '11 at 15:02
• @egreg Just clarifying your instructions; where does "\listfiles" go in the code exactly? Before \documentclass{article} or after \documentclass{article} but before \begin{document}, or after \begin{document} but before all the rest of the code? – ptrcao May 25 '11 at 15:51

You have several possibilities to run PostScript related code with pdflatex:
• run xelatex instead of latexmk, which is the easiest way.
• use package auto-pst-pdf and add the optional argument -shell-escape to the pdflatex call
• instead of pdflatex run latex
• @ptrcao then use package auto-pst-pdf and add the option -shell-escape to the pdflatex call. – user2478 May 25 '11 at 17:13