Thank you Ferdinand.
I have everything working now. The #include <> brackets was just a copy paste thing from the docs. I just had to add the path as you pointed out "maxon/distancequery.h".
One last question about the behavior of
float distance = distanceQuery.GetClosestMeshPrimitive(p, info).
Suppose the user have scaled the polygon mesh using the scale values under the attributes/coordinates. How will this be reflected as a result of the returned distance (assuming the point in the point mesh is first converted to global coordinates and then to local coordinates in the polygon node) like your example above? I see an issue here in my tests where the distance returned is unaffected by the scaling. Either I have done something wrong or the distanceQuery is done on the non "deformed/scaled" mesh.
The point generator in this case is not transformed or deformed in any way.

