Its such a weird error with my C++ code.
I want to maintain a header file with some methods. Lets call it Util.hpp
. I have the below simple method in it.
bool CheckVal(int value) {
if (value == 1)
return true;
else
return false;
}
I include Util.hpp
in another class's cpp & invoke the method. I end up with a linker error saying
:-1: error: 3 duplicate symbols for architecture x86_64
I am building this with clang on osx.
How can I get rid of this error ? what is so wrong in what I am doing ?
I am having the error in spite of inlining the function. really strange !