There seems to be a problem in the statically linked version of VS2012. Starting a console application on an old system leads to an exception, whenever streams are used, although new systems causes no trouble at all. To reproduce this error it is sufficient to
- create a new console application in VS2012
- add the line
std::ofstream f;
orstd::cout << "Hello World";
in the main function (include fstream or iostream as required) - switch to v110_xp toolset (if required for Windows XP)
- switch to statically linked libraries (/MT)
- start the exe on an old system There is always an exception.
Removing the line with ofstream or cout always resolves the problem. Switching to dynamically linked runtime libraries (/MD) always resolves the problem. In case of ofstream, using size optimization (/O1) or no optimization (/Od) instead of speed optimization (/O2) resolved the problem.
Does anyone has an idea or hint? Thanks in advance.