------- Comment #13 from dannysmith at users dot sourceforge dot net 2009-03-09 07:46 ------- (In reply to comment #12) > Was this broken in 4.3 compilers? Is it a 4.4 regression? > This is not a new bug in the compiler (the same multiple definition will occur with 3.4.5) , but an old 'feature' of the the PE-COFF linker
_InterlockedIncrement is defined as an ordinary C library function in lib64_libmingwex_a-wininterlocked.o In thread.cpp, it is defined and emitted using linkonce semantics (it is put into its own .text$_InterlockedIncrement link_once sections, which is how PE-COFF implements vague linkage. The linker grabs the one and only .text$_InterlockedIncrement section in thread.o and then while resolving another symbol it needs from lib64_libmingwex_a-wininterlocked.o finds an ordinary (not .linkonce) definition InterlockedIncrement Hence the multiple definition. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37121