Are there any special rules about inlining?
Yes, there are some rules about inlining -
a.) Any source files which used inline function should contain function's definition.
b.) An inline function should be defined everywhere. Easier way to deal with this to define function once in the class header file and include definition as required. Harder way is to redefine the function everywhere and learn one-definition rule.
c.) Main() can't be inline.