Add #include <cstdlib> to make std::abs(int) available.