Make the compiler from scratch? Don't even try. Edit the code for an existing compiler? More plausible, but still just difficult work and going through tons of code that you probably wouldn't understand.
Making special output for certain errors would be harder than you think - as you may get the same error for different reasons. Your output may further confuse the programmer.
Do you mean writing a new compiler from scratch - or putting a front-end to an existing compiler - eg like wandbox https://wandbox.org/
If writing from scratch - IMO forget it. Even writing a compiler for a much simpler language than C++ is non-trivial. I don't know how long it would take, but I'd guess a few man-years. Then there's the Standard Library which again is probably a few man-years of work...
If you are looking to use an existing compiler as the basis, then there's clang. https://clang.llvm.org/
Random thoughts...
most of the online compilers I have seen are rigged for 1 input file/page. C++ is designed to use a lot of source files in even small programs... just something to think about.
Server horsepower is another issue... how many people compiling at once needs how much computer behind it to deliver reasonable results? What about libraries?
To me, a light VM with a standard IDE (g++, visual studio free version, whatever) solves the problems that a web page cannot. Can you display a VM in a web page? You would need an interface to upload the code etc...