When compiling attached sources, I get: $ g++ -O2 -c test0.cpp $ g++ -O2 -c test1.cpp $ g++ -o test.exe test0.o test1.o test1.o:test1.cpp:(.text+0x0): multiple definition of `non-virtual thunk to FooBase::Bar()' test0.o:test0.cpp:(.text+0x0): first defined here collect2: ld returned 1 exit status Changing -O2 to -O0 or -O1 does not help. Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=c:/snowfishroot/mingw/bin/../libexec/gcc/mingw32/4.6.0/lto-wrapper.exe Target: mingw32 Configured with: ../../../gcc_trunk/configure --build=x86_64-unknown-linux-gnu --host=mingw32 --target=mingw32 --prefix=/mingw --disable-win32-registry --enable-shared --enable-static --enable-libgomp --enable-version-specific-runtime-libs --with-gmp=/mingw --with-mpfr=/mingw --with-ppl=/mingw --with-cloog=/mingw --enable-libstdcxx-debug --with-build-time-tools=/platform/cross-on-linux/mingw --disable-nls --with-mpc=/mingw --enable-languages=c,c++ --enable-lto --disable-plugin --enable-checking=release --enable-sjlj-exceptions Thread model: win32 gcc version 4.6.0 20101228 (experimental) COMPILER_PATH=c:/snowfishroot/mingw/bin/../libexec/gcc/mingw32/4.6.0/;c:/snowfishroot/mingw/bin/../libexec/gcc/;c:/snowfishroot/mingw/bin/../lib/gcc/mingw32/4.6.0/../../../../mingw32/bin/ LIBRARY_PATH=c:/snowfishroot/mingw/bin/../lib/gcc/mingw32/4.6.0/;c:/snowfishroot/mingw/bin/../lib/gcc/;c:/snowfishroot/mingw/bin/../lib/gcc/mingw32/4.6.0/../../../../mingw32/lib/;c:/snowfishroot/mingw/bin/../lib/gcc/mingw32/4.6.0/../../../ COLLECT_GCC_OPTIONS='-v' '-o' 'test.exe' '-shared-libgcc' '-mtune=generic' '-march=pentiumpro' c:/snowfishroot/mingw/bin/../libexec/gcc/mingw32/4.6.0/collect2.exe -Bdynamic -o test.exe c:/snowfishroot/mingw/bin/../lib/gcc/mingw32/4.6.0/../../../crt2.o c:/snowfishroot/mingw/bin/../lib/gcc/mingw32/4.6.0/crtbegin.o -Lc:/snowfishroot/mingw/bin/../lib/gcc/mingw32/4.6.0 -Lc:/snowfishroot/mingw/bin/../lib/gcc -Lc:/snowfishroot/mingw/bin/../lib/gcc/mingw32/4.6.0/../../../../mingw32/lib -Lc:/snowfishroot/mingw/bin/../lib/gcc/mingw32/4.6.0/../../.. test0.o test1.o -lstdc++ -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt c:/snowfishroot/mingw/bin/../lib/gcc/mingw32/4.6.0/crtend.o test1.o:test1.cpp:(.text+0x0): multiple definition of `non-virtual thunk to FooBase::Bar()' test0.o:test0.cpp:(.text+0x0): first defined here collect2: ld returned 1 exit status
Created attachment 22866 [details] sources
duplicate of PR47218 *** This bug has been marked as a duplicate of bug 47218 ***