As mentioned in this tutorial, you could try to include the following include at the top of your code:
#include <pcl/io/pcd_io.h>
Update: by looking at the PCL 1.6 source code here, it looks like the savePolygonFileSTL
function is defined in the vtk_lib_io.h
header. Try to include it adding this line to your code:
#include <pcl/io/vtk_lib_io.h>
Please be sure to have a VTK enabled PCL build.