These approaches work for me:
#include <iostream>
#include <ATen/ATen.h>

using std::cout;
using namespace at;

int main() {
  auto format = [] (Scalar a) {
    std::ostringstream str;
    str << a;
    return str.str();
  };

  std::cout << format(Scalar(c10::complex<double>(2.0, 3.1))) << std::endl;
  std::cout << Scalar(c10::complex<double>(3.2, 4.4)) << std::endl;
  std::cout << c10::complex<float>(4.5, 5.6) << std::endl;

  return 0;
}

Build:
./build# cmake -DCMAKE_PREFIX_PATH=`python -c 'import torch;print(torch.utils.cmake_prefix_path)'` .. && cmake --build . --config Release

Output:
./build# ./example-app 
(2,3.1)
(3.2,4.4)
(4.5,5.6)