Apparently you declared the variable
szicon
to be of type
CSize&
. Reference types are supposed to be const though, and that is what the warning expresses. Change the type to
const CSize&
instead, like this:
const CSize& szicon = CSize(...);
That said, the above wouldn't even work, because the right hand side creates a temporary object of type
CSize
which gets immediately destroyed because it isn't assigned to an actual variable! Why don't you just declare a variable like this:
CSize szicon(...);
?
This should work just as well.