p has been declared as void*. That means that p is void. There is no > operator defined for void, hence the error.
What you need to do is define a function which takes two void* parameters, casts them to the correct type, does the comparison and returns the correct result.
Also, the parameter should be a void** then you pass in two void*s to the function and all is bright and rosy.
Have a look at the template for quicksort and you'll get the general idea.