I have a LaTeX document in which I used "hyperref" package for creating links between different parts of my document. The links are from a word to some piece of text in another section. I use the "book" document class. Links were working fine before I created the table of contents. As soon as I created toc, the links no longer point to the piece of text in target but to the corresponding section in the table of contents.
How can I keep using the table of contents and yet create links that refer directly to a piece of text in my document?
Edit: A Minimum Working Example
\documentclass{book}
\usepackage[dvipdfm]{hyperref}
% Defining a new command for safely creating targets in the section title
\newcommand{\targetInTitle}[2]{\texorpdfstring{\protect\hypertarget{#1}{#2}}{}}
\begin{document}
\tableofcontents
\newpage
\section{\targetInTitle{section1}{Section 1}}
Here is a \hyperlink{section1}{link} which suppose to show me the title of this section on the top of page 2 but, instead, it refers me to the table of contents on page 1.
\end{document}
There is also a warning in dvipdfm operation,
$ dvipdfm test.dvi
test.dvi -> test.pdf
[1][2
xdvipdfmx:warning: Object @section1 already defined.
]
9131 bytes written