I’ve tried, Axel. Too many cpp errors because those little blocks of code in 4.8.1 don’t help me see global strucdture of a working entire script. An entire script, should you happen to have one, would let me see “what goes where” in a cpp header file.
Now getting errors like:
error: ‘using namespace’ is not allowed in classes
48 | using namespace LAMMPS_NS;
warning: extra qualification on member ‘~PairFoo’ [-Wmicrosoft-extra-qualification]
63 | PairFoo::~PairFoo()
error: member initializer ‘a0’ does not name a non-static data member or base class
Please don’t just cut-n-paste pieces of code without understanding what you are doing. Take a step back and carefully read through the text and apply some common sense. What is confusing you now should start to make sense. If it doesn’t you can ask specific questions.
For starters, the entire selection of pair styles in the LAMMPS distribution can serve as a starting point. The page that I have linked discusses how a specific pair style was added, so it is now part of the distribution and the discussion continues with aspects of more complex pair styles.