Here's the question:
I wrote a piece of code on Windows. When using /MT
option, the answer is wrong. When simply switching to /MTd
, the answer is correct.
Now I'm transplanting porting this code to Linux. The answer is wrong using the following command: g++ -Ofast -o test test.cpp
. Also, I'm quite sure that this is the only problem left.
I've installed libc6
, libc6-dbg
, libc6-dev
, libstdc++-4.8-dev
, libstdc++6
and libstdc++6-4.8-dbg
.
What's the problem in this situation and how can I solve it?
Update: Problem solved. Codes can run on Windows (Debug and Release mode) and Linux correctly with various optimization options. There were variable initialization problems. Thanks everyone.