Redefinition error. What?

Hi, I'm getting an interesting error when I attempt to run a program. The error looks like this.

1
2
3
Line File                     Message
7    J:\folder\searchSort.h   redefinition of `template<class elemType> int binarySearch(const elemType*, int, const elemType&)' 
7    J:\folder\searchSort.h   `template<class elemType> int binarySearch(const elemType*, int, const elemType&)' previously declared here 


Previously declared? At the same location in the same file? Anybody know what could be the problem? If it's important, I'm dealing with searching and sorting, as implied by the title of the file, and I did make a copy of the original file for experimenting purposes, in case the copy became fubar, I'd have the original. I'm working with the copy here.

Thanks for reading!
Sounds like you didn't guard your header and it's being included multiple times.

See this:

http://cplusplus.com/forum/articles/10627/#msg49679
"Incidental multiple includes." That about sums it up. Thanks.

I actually have another problem with this program and was tempted to post it here, but it's more appropriate in a separate topic.
Last edited on
Topic archived. No new replies allowed.