I think the link error probably is because that official libtorch is built using gcc 4.x for compatibility and some dependencies of your project is built using gcc 5.x or higher version.
Try to build libtorch from source?