As pointed out in the comments by @berak the correct include and class name are cv::xfeatures2d::SURF, and #include "opencv2/xfeatures2d.hpp".
As pointed out in the comments by @berak the correct include and class name are cv::xfeatures2d::SURF, and #include "opencv2/xfeatures2d.hpp".. So use for example:
cv::Ptr<cv::xfeatures2d::SURF> surf = cv::xfeatures2d::SURF::create(400);