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
std::ofstream f;
or std::cout << "Hello World";
in the main function
(include fstream or iostream as required)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.
Solved by myself - my first assumption was wrong:
Visual Studio 2012 uses SSE2 instructions by default. This causes trouble on old systems such as Intel Pentium III or AMD Athlon XP, which do not support SSE2. An invalid instruction exception is thrown.
You can switch of SSE2 using the /arch:IA32
compiler option.
The dynamically linked msvcrt (DLL) does work in all case, as it is not affected by the /arch
compiler option.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With