C1035: Friend must be declared in class declaration

[ERROR]

Description

The specified function was declared with the friend specifier outside of a class, structure or union.

Example
  friend void foo(void);

  
Tips

Do not use the friend specifier outside of class, structure or union declarations.