[Tex/LaTex] Problem with importing bibtex-file in a Thesis Template

bibtextemplates

For my bachelor thesis I downloaded a template made available by my university.
However the standard bibliography part was using

\begin{thebibliography}
\end{thebibliography}

Since I had already prepared a .bib file for my bibliography I wanted to use that so I tried the following code

\nocite{*}
\bibliography{BachelorBib}
\bibliographystyle{apalike}

I put my bib-file in the same folder as everything else and I tried putting the code above in the file prepared for the bibliography (which is then included in the main file) and bibtex-compiling that file, I tried just bibtex-compiling the main file. And I tried putting the code above directly in my main file and the bibtex-compiling that main file.

However each time I try to compile my main file to get an output I still don't get my bibliography.

The error-message I get after bibtex-compiling is:

This is BibTeX, Version 0.99d (TeX Live 2013) The top-level auxiliary file: boek.aux
A level-1 auxiliary file: titel.aux A level-1 auxiliary file: voorwoord.aux
A level-1 auxiliary file: hoofdstuk1.aux The style file: apalike.bst
A level-1 auxiliary file: referenties.aux Multiple inclusions of entire database
---line 2 of file referenties.aux : \citation{* : }
I'm skipping whatever remains of this command Illegal,
another \bibdata command---line 3 of file referenties.aux :
\bibdata : {BachelorBib} I'm skipping whatever remains of this command
Illegal, another \bibstyle command---line 4 of file referenties.aux :
\bibstyle : {apalike} I'm skipping whatever remains of this command
Database file #1: BachelorBib.bib (There were 3 error messages)

Can somebody help me with this?

Best Answer

Try using your commands in reverse order:

\usepackage[square,numbers,sort&compress]{natbib}


\bibliographystyle{apalike}    
\bibliography{BachelorBib}

I have done in that way and it worked for me. I believe it didn't have anything to do with package which I used. My bibliography style was ieeetr. Just give it a try.