a text based MMORPG is normally called a MUD, what you are looking for is a MUD Codebase, you can find alot of them here:
http://www.mudconnect.com/resources/..._Snippets.html
and as for the problem with your code, you are going to need to either run it through the command prompt or try adding
after the line which prints hello world.
but don't trust me completely on that since i've never touched c++, opening through the command prompt should definately work though.