I only get errors when using -flto with mingw-w64. With no -flto flag theres no errors and with gnu g++ theres no error. Is this just a bug in mingw? Is there a work around? [greg@greg-desktop polyedit]$ i686-w64-mingw32-g++ -v Using built-in specs. COLLECT_GCC=i686-w64-mingw32- g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-w64-mingw32/4.9.1/lto-wrapper Target: i686-w64-mingw32 Configured with: /build/mingw-w64-gcc/src/gcc-4.9.1/configure --prefix=/usr --libexecdir=/usr/lib --target=i686-w64-mingw32 --enable-languages=c,lto,c++,objc,obj-c++,fortran,ada --enable-shared --enable-static --enable-threads=posix --enable-fully-dynamic-string --enable-libstdcxx-time=yes --with-system-zlib --enable-cloog-backend=isl --disable-cloog-version-check --disable-isl-version-check --enable-lto --disable-dw2-exceptions --enable-libgomp --disable-multilib --enable-checking=release Thread model: posix gcc version 4.9.1 (GCC) i686-w64-mingw32-g++ -DSFML_STATIC -Wall -s -O3 -flto -std=c++11 -I. -I/home/greg/SFML/include -I/usr/i686-w64-mingw32/lib/wx/include/i686-w64-mingw32-msw-unicode-static-3.0 -I/usr/i686-w64-mingw32/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -D__WXMSW__ -MMD -MP -c -o .build/./sources/Drawables.o sources/Drawables.cpp i686-w64-mingw32-g++ -DSFML_STATIC -Wall -s -O3 -flto -std=c++11 -I. -I/home/greg/SFML/include -I/usr/i686-w64-mingw32/lib/wx/include/i686-w64-mingw32-msw-unicode-static-3.0 -I/usr/i686-w64-mingw32/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -D__WXMSW__ -MMD -MP -c -o .build/./sources/MainWindow.o sources/MainWindow.cpp i686-w64-mingw32-g++ -DSFML_STATIC -Wall -s -O3 -flto -std=c++11 -I. -I/home/greg/SFML/include -I/usr/i686-w64-mingw32/lib/wx/include/i686-w64-mingw32-msw-unicode-static-3.0 -I/usr/i686-w64-mingw32/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -D__WXMSW__ -MMD -MP -c -o .build/./sources/ToolBar.o sources/ToolBar.cpp i686-w64-mingw32-g++ -DSFML_STATIC -Wall -s -O3 -flto -std=c++11 -I. -I/home/greg/SFML/include -I/usr/i686-w64-mingw32/lib/wx/include/i686-w64-mingw32-msw-unicode-static-3.0 -I/usr/i686-w64-mingw32/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -D__WXMSW__ -MMD -MP -c -o .build/./sources/Canvas.o sources/Canvas.cpp i686-w64-mingw32-g++ -o polyedit.exe .build/./sources/Canvas.o .build/./sources/ToolBar.o .build/./sources/MainWindow.o .build/./sources/Drawables.o -flto -s -O3 -static -static-libgcc -static-libstdc++ -L/home/greg/SFML/lib/ -lsfml-graphics-s -lsfml-window-s -lsfml-system-s -Wl,--subsystem,windows -mwindows /usr/i686-w64-mingw32/lib/libwx_mswu_xrc-3.0-i686-w64-mingw32.a /usr/i686-w64-mingw32/lib/libwx_mswu_webview-3.0-i686-w64-mingw32.a /usr/i686-w64-mingw32/lib/libwx_mswu_qa-3.0-i686-w64-mingw32.a /usr/i686-w64-mingw32/lib/libwx_baseu_net-3.0-i686-w64-mingw32.a /usr/i686-w64-mingw32/lib/libwx_mswu_html-3.0-i686-w64-mingw32.a /usr/i686-w64-mingw32/lib/libwx_mswu_adv-3.0-i686-w64-mingw32.a /usr/i686-w64-mingw32/lib/libwx_mswu_core-3.0-i686-w64-mingw32.a /usr/i686-w64-mingw32/lib/libwx_baseu_xml-3.0-i686-w64-mingw32.a /usr/i686-w64-mingw32/lib/libwx_baseu-3.0-i686-w64-mingw32.a /home/greg/libpng-1.2.52/libpng12_static.a /usr/i686-w64-mingw32/lib/libjpeg.a -ltiff -lexpat -lwxregexu-3.0-i686-w64-mingw32 /usr/i686-w64-mingw32/lib/libz.a -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -ladvapi32 -lwsock32 -lgdi32 -lglew -lopengl32 .build/./sources/MainWindow.o (symbol from plugin):(.gnu.linkonce.t._ZN11ImageCanvasD1Ev[__ZThn360_N11ImageCanvasD1Ev]+0x0): multiple definition of `ImageCanvas::~ImageCanvas()' .build/./sources/Canvas.o (symbol from plugin):(.gnu.linkonce.t._ZN11ImageCanvasD1Ev[__ZThn400_N11ImageCanvasD1Ev]+0x0): first defined here .build/./sources/MainWindow.o (symbol from plugin):(.gnu.linkonce.t._ZN11ImageCanvasD1Ev[__ZThn360_N11ImageCanvasD1Ev]+0x0): multiple definition of `non-virtual thunk to ImageCanvas::~ImageCanvas()' .build/./sources/Canvas.o (symbol from plugin):(.gnu.linkonce.t._ZN11ImageCanvasD1Ev[__ZThn400_N11ImageCanvasD1Ev]+0x0): first defined here .build/./sources/MainWindow.o (symbol from plugin):(.gnu.linkonce.t._ZN11ImageCanvasD1Ev[__ZThn360_N11ImageCanvasD1Ev]+0x0): multiple definition of `non-virtual thunk to ImageCanvas::~ImageCanvas()' .build/./sources/Canvas.o (symbol from plugin):(.gnu.linkonce.t._ZN11ImageCanvasD1Ev[__ZThn400_N11ImageCanvasD1Ev]+0x0): first defined here .build/./sources/MainWindow.o (symbol from plugin):(.gnu.linkonce.t._ZN11ImageCanvasD0Ev[__ZThn360_N11ImageCanvasD0Ev]+0x0): multiple definition of `ImageCanvas::~ImageCanvas()' .build/./sources/Canvas.o (symbol from plugin):(.gnu.linkonce.t._ZN11ImageCanvasD0Ev[__ZThn400_N11ImageCanvasD0Ev]+0x0): first defined here .build/./sources/MainWindow.o (symbol from plugin):(.gnu.linkonce.t._ZN11ImageCanvasD0Ev[__ZThn360_N11ImageCanvasD0Ev]+0x0): multiple definition of `non-virtual thunk to ImageCanvas::~ImageCanvas()' .build/./sources/Canvas.o (symbol from plugin):(.gnu.linkonce.t._ZN11ImageCanvasD0Ev[__ZThn400_N11ImageCanvasD0Ev]+0x0): first defined here .build/./sources/MainWindow.o (symbol from plugin):(.gnu.linkonce.t._ZN11ImageCanvasD0Ev[__ZThn360_N11ImageCanvasD0Ev]+0x0): multiple definition of `non-virtual thunk to ImageCanvas::~ImageCanvas()' .build/./sources/Canvas.o (symbol from plugin):(.gnu.linkonce.t._ZN11ImageCanvasD0Ev[__ZThn400_N11ImageCanvasD0Ev]+0x0): first defined here .build/./sources/MainWindow.o (symbol from plugin):(.gnu.linkonce.t._ZN10GridCanvasD1Ev[__ZThn360_N10GridCanvasD1Ev]+0x0): multiple definition of `GridCanvas::~GridCanvas()' .build/./sources/Canvas.o (symbol from plugin):(.gnu.linkonce.t._ZN10GridCanvasD1Ev[__ZThn400_N10GridCanvasD1Ev]+0x0): first defined here .build/./sources/MainWindow.o (symbol from plugin):(.gnu.linkonce.t._ZN10GridCanvasD1Ev[__ZThn360_N10GridCanvasD1Ev]+0x0): multiple definition of `non-virtual thunk to GridCanvas::~GridCanvas()' .build/./sources/Canvas.o (symbol from plugin):(.gnu.linkonce.t._ZN10GridCanvasD1Ev[__ZThn400_N10GridCanvasD1Ev]+0x0): first defined here .build/./sources/MainWindow.o (symbol from plugin):(.gnu.linkonce.t._ZN10GridCanvasD1Ev[__ZThn360_N10GridCanvasD1Ev]+0x0): multiple definition of `non-virtual thunk to GridCanvas::~GridCanvas()' .build/./sources/Canvas.o (symbol from plugin):(.gnu.linkonce.t._ZN10GridCanvasD1Ev[__ZThn400_N10GridCanvasD1Ev]+0x0): first defined here .build/./sources/MainWindow.o (symbol from plugin):(.gnu.linkonce.t._ZN10GridCanvasD0Ev[__ZThn360_N10GridCanvasD0Ev]+0x0): multiple definition of `GridCanvas::~GridCanvas()' .build/./sources/Canvas.o (symbol from plugin):(.gnu.linkonce.t._ZN10GridCanvasD0Ev[__ZThn400_N10GridCanvasD0Ev]+0x0): first defined here .build/./sources/MainWindow.o (symbol from plugin):(.gnu.linkonce.t._ZN10GridCanvasD0Ev[__ZThn360_N10GridCanvasD0Ev]+0x0): multiple definition of `non-virtual thunk to GridCanvas::~GridCanvas()' .build/./sources/Canvas.o (symbol from plugin):(.gnu.linkonce.t._ZN10GridCanvasD0Ev[__ZThn400_N10GridCanvasD0Ev]+0x0): first defined here .build/./sources/MainWindow.o (symbol from plugin):(.gnu.linkonce.t._ZN10GridCanvasD0Ev[__ZThn360_N10GridCanvasD0Ev]+0x0): multiple definition of `non-virtual thunk to GridCanvas::~GridCanvas()' .build/./sources/Canvas.o (symbol from plugin):(.gnu.linkonce.t._ZN10GridCanvasD0Ev[__ZThn400_N10GridCanvasD0Ev]+0x0): first defined here Warning: resolving _glewInit@0 by linking to _glewInit Use --enable-stdcall-fixup to disable these warnings Use --disable-stdcall-fixup to disable these fixups Warning: resolving _glewGetErrorString@4 by linking to _glewGetErrorString collect2: error: ld returned 1 exit status Makefile-win:44: recipe for target 'polyedit.exe' failed make: *** [polyedit.exe] Error 1