MingwUseSTLA strange running error occurs.
Recent progress OpenGL Load-down 3DS The development environment is Windows XP +
Mingw4.4 + qtcreator2.61 . Mingw4.4 Is dedicated for development Qt ApplicationProgramCompiler, relatively up-to-date Mingw Compiler ( 4.7 . During programming, I found that STL In Vector As a member of my custom class, a running error occurs. The details are called in one of the member functions. Vector: size () Function, which can be returned correctly, but when this function is generated, Vector: size () An error occurs when calling. 117040789 (I cannot remember the exact number. This is probably the number ). New Will return an error. Since this compiler has never been triggered before Bug So at first I had a long time and wrote a lot. Cerr And Assert , Use GDB There is no way.
the current solution is to re-layout the memory of the custom class and apply all STL is written in one piece, or the memory layout of the class is as follows: Class Members with a large granularity are placed in front, and data members with a small granularity are placed behind, which relieves a little. I tested it. After the memory layout is changed, vector: size () .