What did your debugger say? Was the segfault caused by dereferencing a pointer returned by a failed dynamic_cast?
To my knowledge flto has never been working perfectly since g++ 4.8 on Windows: multiple definitions, undefined references, pointer-to-function referring garbage memory, valid pointers becoming null, random segment faults, etc... I strongly suggest you not use flto in production builds. ------------------ Best regards, lh_mouse 2015-05-29 ------------------------------------------------------------- 发件人:Etienne Sandré-Chardonnal <etienne.san...@m4x.org> 发送日期:2015-05-29 00:33 收件人:mingw-w64-public 抄送: 主题:Re: [Mingw-w64-public] Multiple definition issue with -flto, MinGW-w64 4.9.1 Hi, This worked, the program compiles fine now. It crashes with a SegFault shortly after starting a new thread (via QThread), with a message: RTTI symbol not found for class 'SimClientPrivate' Are there incompatibilities of flto and cases where it cannot work? Thanks > FWIW, you can try moving virtual function definitions out of header files, as > defining virtual functions inside headers is generally a bad idea. > > (The story is much longer than that. Since the RTTI data of a polymorphic > class is linked/exported/whatever with one of its virtual functions, specific > mechanisms that rely on RTTI - dynamic_cast, exceptions, etc - might fail if > RTTI of the same class is used across dynami clibrary boundaries.) > > ------------------------------------------------------------------------------ _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public ------------------------------------------------------------------------------ _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public