  Let $N$ be any fixed positive integer and define \begin{align*}
  S_N(x)=\sum_{m, n \leq x}d(n^2+Nm^2), \end{align*}
  where $d(n)$ is the divisor function. We evaluate asymptotically $S_N(x)$ for
several $N$, extending earlier works of Gafurov and Yu on the case $N=1$.
