# Error when using pst-circ [duplicate]

The code is shown as follows:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{pst-circ}

\begin{document}
\begin{center}
\begin{pspicture}[showgrid=true](3,2)
\pnodes(0,1){A}(3,1){B}
\resistor(A)(B){$R$}
\end{pspicture}
\end{center}
\end{document}
\usepackage{pst-circ}


and it shows "Undefined control sequence" at line 9 and 10.

How can I solve this?

• Welcome to TeX.SE... Your code works fine for me, may the problem lies in version, please update with current setup and then try... – MadyYuvi Oct 11 '19 at 5:51
• Well, I've tried this code in an online compiler and it didn't work...... and all of my local packages are the newest...... – ygy Oct 11 '19 at 9:26
• Ok, I've got a solution. pdflatex not compatible So it is needed to switch to another TeX compiler. Such as xelatex. – ygy Oct 11 '19 at 10:43