I realize that this thread is 2 years old, but it is the top search result for this error message, so maybe I will help a fellow newb.
If you are using the dev c++ enviroment,as I am, and probably other enviroments. The Error is caused by not hitting enter after the last line of code.