I know, that this error has been answered in various forms here, but I was unable to find a solution to my problem.
The following code gives me errors:
There were undefined references. LaTeX [1,1]
Label(s) may have changed. Rerun to get cross-references right. LaTeX [1,1]
Reference `equality' on page 1 undefined. LaTeX [10,1]
The "LaTeX[r,c]" just refers to the r-th line and c-th column of the code. My code is:
\documentclass{article}
\usepackage{bookmark}
\usepackage{hyperref}
\begin{document}
Hello.
\begin{equation}
x=y\label{equality}
\end{equation}
Refer \ref{equality}.
\end{document}
I do pdflatex -> bibtex -> pdflatex -> pdflatex.
Also, I ran it several times in a row and none of the warnings go away.
My output has ??, where my code has \ref{}. It looks like this:
Any help is appreciated. EDIT: I am posting the log after my second compile, in case it is needed.
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (MiKTeX 2.9.7050 64-bit)
entering extended mode
("c:/Users/adamy/OneDrive/TeX/Tests/New folder/Test file 2.tex"
LaTeX2e <2018-12-01>
("C:\Users\adamy\AppData\Local\Programs\MiKTeX 2.9\tex/latex/base\article.cls"
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
("C:\Users\adamy\AppData\Local\Programs\MiKTeX 2.9\tex/latex/base\size10.clo")) ("C:\Users\adamy\AppData\Local\Programs\MiKTeX 2.9\tex/latex/oberdiek\bookmark.sty" ("C:\Users\adamy\AppData\Local\Programs\MiKTeX 2.9\tex/generic/oberdiek\pdfescape.sty" ("C:\Users\adamy\AppData\Local\Programs\MiKTeX 2.9\tex/generic/oberdiek\ltxcmds.sty") ("C:\Users\adamy\AppData\Local\Programs\MiKTeX 2.9\tex/generic/oberdiek\pdftexcmds.sty" ("C:\Users\adamy\AppData\Local\Programs\MiKTeX 2.9\tex/generic/oberdiek\infwarerr.sty") ("C:\Users\adamy\AppData\Local\Programs\MiKTeX 2.9\tex/generic/oberdiek\ifluatex.sty") ("C:\Users\adamy\AppData\Local\Programs\MiKTeX 2.9\tex/generic/oberdiek\ifpdf.sty"))) ("C:\Users\adamy\AppData\Local\Programs\MiKTeX 2.9\tex/generic/ifxetex\ifxetex.sty") ("C:\Users\adamy\AppData\Local\Programs\MiKTeX 2.9\tex/generic/oberdiek\ifvtex.sty") ("C:\Users\adamy\AppData\Local\Programs\MiKTeX 2.9\tex/latex/hyperref\hyperref.sty" ("C:\Users\adamy\AppData\Local\Programs\MiKTeX 2.9\tex/generic/oberdiek\hobsub-hyperref.sty" ("C:\Users\adamy\AppData\Local\Programs\MiKTeX 2.9\tex/generic/oberdiek\hobsub-generic.sty")) ("C:\Users\adamy\AppData\Local\Programs\MiKTeX 2.9\tex/latex/graphics\keyval.sty") ("C:\Users\adamy\AppData\Local\Programs\MiKTeX 2.9\tex/latex/oberdiek\auxhook.sty") ("C:\Users\adamy\AppData\Local\Programs\MiKTeX 2.9\tex/latex/oberdiek\kvoptions.sty") ("C:\Users\adamy\AppData\Local\Programs\MiKTeX 2.9\tex/latex/hyperref\pd1enc.def") ("C:\Users\adamy\AppData\Local\Programs\MiKTeX 2.9\tex/latex/00miktex\hyperref.cfg") ("C:\Users\adamy\AppData\Local\Programs\MiKTeX 2.9\tex/latex/url\url.sty")) ("C:\Users\adamy\AppData\Local\Programs\MiKTeX 2.9\tex/latex/hyperref\hpdftex.def" ("C:\Users\adamy\AppData\Local\Programs\MiKTeX 2.9\tex/latex/oberdiek\rerunfilecheck.sty")) ("C:\Users\adamy\AppData\Local\Programs\MiKTeX 2.9\tex/latex/oberdiek\bkm-pdftex.def"))
No file "Test file 2".aux.
("C:\Users\adamy\AppData\Local\Programs\MiKTeX 2.9\tex/latex/hyperref\nameref.sty" ("C:\Users\adamy\AppData\Local\Programs\MiKTeX 2.9\tex/generic/oberdiek\gettitlestring.sty"))
LaTeX Warning: Reference `equality' on page 1 undefined on input line 10.
[1{C:/Users/adamy/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}] ("Test file 2.aux")
LaTeX Warning: There were undefined references.
LaTeX Warning: Label(s) may have changed. Rerun to get
cross-references right.
)<C:/Users/adamy/AppData/Local/Programs/MiKTeX
2.9/fonts/type1/public/amsfonts/cm/cmbx10.pfb><C:/Users/adamy/AppData/Local/Programs/MiKTeX
2.9/fonts/type1/public/amsfonts/cm/cmmi10.pfb><C:/Users/adamy/AppData/Local/Programs/MiKTeX
2.9/fonts/type1/public/amsfonts/cm/cmr10.pfb> Output written on "Test file 2.pdf" (1 page, 30446 bytes). SyncTeX written on "Test file
2.synctex.gz" Transcript written on "Test file 2.log". This is BibTeX, Version 0.99d (MiKTeX 2.9.7050 64-bit) The top-level auxiliary file:
Test file 2.aux I found no \citation commands---while reading file
Test file 2.aux I found no \bibdata command---while reading file Test
file 2.aux I found no \bibstyle command---while reading file Test file
2.aux (There were 3 error messages)

hyperrefpackage. When creating cross-references via LaTeX's\label-\refmechanism, it's crucial to compile the document (at least) twice in order to resolve the cross-references. To be sure, I get??along with a "There were undefined references" warning the first time I compile your MWE, and I get1(surrounded by a red rectangle, ahyperrefis loaded) the second time I compile the test document. If you keep getting??, you must check if the aux file is somehow being deleted between compilation runs. – Mico Jul 06 '19 at 18:19No file "Test file 2".aux., this means that something has deleted it. Don't use texify to compile, use pdflatex directly. – Ulrike Fischer Jul 06 '19 at 18:51hyperrefneeds the previous files to exist and be updated rather than recreate them from scratch. Does this explanation fit in? Recreating from scratch vs updating files? – odomosis Jul 06 '19 at 20:11hyperref. – Mico Jul 06 '19 at 20:43