[Tex/LaTex] Question marks showing up while trying to reference equation

cross-referencingntheorem

Similar questions have been asked, but I've found them to be of no help. When I try to reference an equation in texstudio, all I get is ?? An example of code I have inserted which does this (I have taken this from Wikipedia) is:

$$\label{eq:solve} x^2 - 5 x + 6 = 0$$

$$x_1 = \frac{5 + \sqrt{25 - 4 \times 6}}{2} = 3$$

$$x_2 = \frac{5 - \sqrt{25 - 4 \times 6}}{2} = 2$$

and so we have solved equation ~\ref{eq:solve}


Instead of it displaying a number I just get ??, and yes I've compiled more than once.

For completeness I'll include the beginning of my code:

\documentclass{book}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{MnSymbol}
\usepackage[thmmarks]{ntheorem}
\theorembodyfont{\normalfont}
\theoremseparator{:}
\theoremsymbol{$\square$}
\newtheorem*{proof}{Proof}[chapter]
\newtheorem{prop}{Proposition}[chapter]
\newtheorem{corollary}{Corollary}[chapter]
\newtheorem{theorem}{Theorem}[chapter]
\newtheorem{lemma}{Lemma}
\numberwithin{theorem}{section}
\numberwithin{prop}{section}
\numberwithin{corollary}{section}
\numberwithin{lemma}{section}


You need to specify the option amsmath (in addition to the option thmmarks) when loading the ntheorem package. (See also section 3.2.1 of the user guide of the ntheorem package.)