to_string not declared in scope

There could be different reasons why it doesn’t work for you: perhaps you need to qualify the name with std::, or perhaps you do not have C++11 support. This works, provided you have C++11 support: To enable C++11 support with g++ or clang, you need to pass the option -std=c++0x. You can also use -std=c++11 on the newer versions … Read more

LNK1168: cannot open debug\file.exe for writing

I have qt project but if I edit my code, Qt creator throws out this error :-1: error: LNK1168: cannot open debug\GettingStarted.exe for writing I’m not able even to delete the debug folder (i.e. as an administrator). I have to log off and then come back. What is the problem and how can I solve … Read more

error: expected unqualified-id before ‘if’

You can’t have free-standing code like that. All code needs to go into functions. Wrap all that in a main function and you should be ok once you’ve fixed your use of QTextStream (it has no eof method, and it doesn’t have a readline method either – please look at the API docs that come with usage examples).