The compiler, through its error messages, tells you important things. If we take only the first message (it is always useful to keep track of the compilation tasks one by one, starting from the first thing that happened):
parseexception.h:9: error: expected class-name before '{' token
This means that you are looking at line 9. In the code before the problem "{" there is a problem: the class name is not valid. You can deduce from this that the compiler may not know what "std :: runtime_error" is. This means that the compiler does not find "std :: runtime_error" in the headers you specify. Then you need to check if the correct headers are included.
A quick search in the C ++ help documentation will tell you that std :: runtime_error is part of the <stdexcept> header, not the <exception> . This is a common mistake.
You just need to add this header and the error will disappear. Of the other error messages, the compiler tells you about the same things, but in the constructors.
Learning to read compiler error messages is a very important skill to avoid blocking compilation problems.
source share