This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/37121] New: g++ create global symbol for inline function, which make link failed with multiple defination
- From: "drangon dot mail at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Aug 2008 07:03:30 -0000
- Subject: [Bug c++/37121] New: g++ create global symbol for inline function, which make link failed with multiple defination
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
when use g++ to build wxWidgets in x86_64-pc-mingw32, it output following error
:
------------------
E:\work\09_workroom\wxtest\png>mingw32-make -f Makefile.mingw
WX_DIR=e:\code\wx6
4 CXX=e:\code\target\bin\g++.exe
e:\code\target\bin\g++.exe -g -Wall -pipe -D__WXMSW__ -D__WXDEBUG__ -DWIN32
-D_
WINDOWS -Ie:\code\wx64/include -Ie:\code\wx64/lib/mswd png.o stdafx.o -o
png.e
xe -mwindows -Le:\code\wx64/lib -lwxmsw28d_core -lwxbase28d -lwxpngd -lwxzlibd
-
lgdi32 -lole32 -loleaut32 -lwinmm -lcomctl32 -lcomdlg32 -lwinspool -luuid
-lshel
l32 -lrpcrt4
e:/code/target/bin/../lib/gcc/x86_64-pc-mingw32/4.3.2/../../../../x86_64-pc-ming
w32/lib/libmingwex.a(lib64_libmingwex_a-wininterlocked.o):wininterlocked.c:(.tex
t+0x43b): multiple definition of `_InterlockedIncrement'
e:\code\wx64/lib/libwxbase28d.a(baselib_thread.o):thread.cpp:(.text$_Interlocked
Increment[__InterlockedIncrement]+0x0): first defined here
e:/code/target/bin/../lib/gcc/x86_64-pc-mingw32/4.3.2/../../../../x86_64-pc-ming
w32/lib/libmingwex.a(lib64_libmingwex_a-wininterlocked.o):wininterlocked.c:(.tex
t+0x487): multiple definition of `_InterlockedDecrement'
e:\code\wx64/lib/libwxbase28d.a(baselib_thread.o):thread.cpp:(.text$_Interlocked
Decrement[__InterlockedDecrement]+0x0): first defined here
collect2: ld returned 1 exit status
mingw32-make: *** [png.exe] Error 1
-----------------
_InterlockedDecrement is an inline function, it should not in baselib_thread.o,
when built with "-O1", its ok. when built with "-O2", g++ crashed.
see attachment for more infomation.
--
Summary: g++ create global symbol for inline function, which make
link failed with multiple defination
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: drangon dot mail at gmail dot com
GCC build triplet: x86_64-redhat-linux-gnu
GCC host triplet: x86_64-pc-mingw32
GCC target triplet: x86_64-pc-mingw32
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37121