[Tex/LaTex] LaTeX Warning: Citation `foo’ on page N undefined on input line XX

bibtex

When I compile my tex document, I receive some warnings on all bib entries. The warning is

 LaTeX Warning: Citation `foo' on page N undefined on input line XX.

The commands I use are

 bibtex template.tex
 I couldn't open file name `template.tex.aux'

 pdflatex template.tex
 ....
 LaTeX Warning: Citation `foo' on page N undefined on input line XX.

The document is

documentclass[pageno]{jpaper}

\usepackage[normalem]{ulem}
\usepackage{array}
\usepackage{mathtools}
\usepackage{multirow}
\usepackage{rotating}

\begin{document}

\title{the tile}

\date{}
\maketitle

\begin{abstract}
the abs
\end{abstract}

\section{Introduction}
 ....
\bstctlcite{bstctl:etal, bstctl:nodash, bstctl:simpurl}
\bibliographystyle{IEEEtranS}
\bibliography{references}

\end{document}

And the reference.bib file is

@IEEEtranBSTCTL{bstctl:etal,
  CTLuse_forced_etal = {no},
  CTLmax_names_forced_etal = {3},
}

@IEEEtranBSTCTL{bstctl:nodash,
  CTLdash_repeated_names = {no},
}

@IEEEtranBSTCTL{bstctl:simpurl,
  CTLname_url_prefix = {Available: },
}


@inproceedings{foo,
  author = "some ones",
  title = "{something}",
  booktitle = {proc},
  year = {2011},
  pages = {1-2},
}
 ....

What does the warning mean?

Best Answer

bibtex template.tex will never work.

you first need to run latex on template.tex, then just bibtex template and bibtex will look for template.aux.

when you again run latex (it has to be run twice), the citation references should be available.