Resolving 'undefined reference' error?

Example:


  void func();
  int main() {
      func();
  }
  

Solution:


  void func() {
      // function definition here
  }
  int main() {
      func();
  }
  

Beginner's Guide to C++