[Solved] Hyperref isn’t working right with lineno

generallyconfuzzled Asks: Hyperref isn’t working right with lineno
For my end-of-year stats notes, I cite everything in line numbers because it makes everything much more specific, and it’s relevant to my needs. I tried adding in hyperlinks so that it would be easier to move around the pdf, as it’s gotten quite sizeable, but the hyperref package has started to put out the following warning:

Code:
Suppressing link with empty target on input line [line number].

I’m not entirely sure why this is happening. (I will note that I’ve been using commands fromline to label lines and toline to reference them in order to increase efficiency, but I don’t see why that would be a problem.)

Code:
documentclass{article}
usepackage{hyperref}
usepackage{lineno}

hypersetup{
    colorlinks=true,
    linkcolor=red,
    filecolor=magenta,      
    urlcolor=red,
    linktocpage=true,
    }

newcommand{fromline}[1]{linelabel{#1}hypertarget{#1}{ }}
newcommand{toline}[1]{hyperlink{#1}{lineref{#1}}}

begin{document}
fromline{bells} Olim, olim Deus accelere, hoc sæculum splendidum. Accelere fiat venire olim.

The first part of textit{The Bells of Notre Dame} is in Latin, as found on line toline{bells}.
end{document}

It also doesn’t make links in the table of contents, which is something I would like. Does anyone know why this might be? Thanks!!!!!

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.