I was working on a project recently within Visual Studio 2010. I added something similar to the following:
header.h
#include "someh.h"
someho * value;
implement.cpp
#include "header.h"
#include "someh.h"
value = new someho();
The editor then showed the following error:
Error: A value of type 'someho *' cannot be assigned to an entity of type 'someho *'
A search of the internet brought up various articles. None directly applied to nor resolved my problem.
However, there was one article (here) that did give me a hint. The article stated that this error often occurs when a class has been redefined. So, a quick inspection of the header someh.h revealed that it did not contain an include guard. Since "some.h" was included in both header.h and implement.cpp, the object someho was technically being redefined. So, I put an include guard in "someh.h" and the error was resolved.
It sure would be nice if the compiler error was a little bit clearer.
THANK YOU!
solved an annoying problem...
Thanks!!
I faced this error in my code today, googled about it and found your blog.
Thanks.. it solved my problem!!
You're welcome ...
Glad I could help!
thank you very much, solved
thank you very much, solved my problem