GDB Error: "The program is not being run"

Sometimes gdb show error message "The program is not being run". This is very common error most of gdb users face.
This post describes this error message and how to fix this error.

What does this error mean, "The program is not being run"?
This error tells, program is not running. By "not running" means program hasn't even started executing. So its not like that program has been paused in between which happens when breakpoint is hit.

When this error occurs?
When such gdb command is executed, which is applicable only when program execution has been started, then gdb shows this error message notifying that gdb can't execute command because program is not running.
Generally people face this error while executing continue command without starting execution of program.

How to fix this error?
It is very easy to fix this error. Just start running program using run or start command, and then execute your desired command.

Happy Debugging!