Bug 47116 - Linking error: multiple definition of `non-virtual thunk to ...'
Summary: Linking error: multiple definition of `non-virtual thunk to ...'
Status: RESOLVED DUPLICATE of bug 47218
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-29 14:34 UTC by Yu Simin
Modified: 2011-01-08 15:12 UTC (History)
0 users

See Also:
Host:
Target: mingw32
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
sources (329 bytes, application/x-tar)
2010-12-29 14:35 UTC, Yu Simin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yu Simin 2010-12-29 14:34:04 UTC
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
Comment 1 Yu Simin 2010-12-29 14:35:31 UTC
Created attachment 22866 [details]
sources
Comment 2 Yu Simin 2011-01-08 15:12:11 UTC
duplicate of PR47218

*** This bug has been marked as a duplicate of bug 47218 ***