In C++, unlike in C,
void *
is not implicitly convertible to other pointer types, you must explicitly convert (aka "cast") it. Your code doesn't do a cast, and attempts an implicit conversion.