Access cutoff+skin from within a fix

Dear Lammps users,

I’m working on a fix where I need the pair-cutoff and the skin-length for some computations.
How can I access these values?
I’ve already tried


However, this gives me an error "invalid use of incomplete type ‘class LAMMPS_NS::Pair’ "

any hints?

This is probably because the LAMMPS_NS::Pair class is forward declared, so you need to include the proper header file in your source code:

#include “pair.h”

Without that, the compiler only knows that there is a class called LAMMPS_NS::Pair, but it has no information about the contents (member variables and so on).