https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61329
Bug ID: 61329 Summary: #include <regex> and _GLIBCXX_DEBUG causes multiple symbol definition. Product: gcc Version: 4.9.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: pluto at agmk dot net Created attachment 32860 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32860&action=edit testcase % g++ t.cpp -Og -g0 -c -std=c++11 -D_GLIBCXX_DEBUG % g++ u.cpp -Og -g0 -c -std=c++11 -D_GLIBCXX_DEBUG % g++ t.o u.o -s -o /dev/null u.o: In function `std::__detail::__7::_State_base::_M_print(std::__7::basic_ostream<char, std::__7::char_traits<char> >&) const': u.cpp:(.text+0x0): multiple definition of `std::__detail::__7::_State_base::_M_print(std::__7::basic_ostream<char, std::__7::char_traits<char> >&) const' t.o:t.cpp:(.text+0x0): first defined here u.o: In function `std::__detail::__7::_State_base::_M_dot(std::__7::basic_ostream<char, std::__7::char_traits<char> >&, long) const': u.cpp:(.text+0x1ae): multiple definition of `std::__detail::__7::_State_base::_M_dot(std::__7::basic_ostream<char, std::__7::char_traits<char> >&, long) const' t.o:t.cpp:(.text+0x1ae): first defined here collect2: error: ld returned 1 exit status % g++ -v Using built-in specs. COLLECT_GCC=/ahome/pawels/dvm/master/toolchain/gcc/sysroot/x86_64-gnu-linux/bin/x86_64-gnu-linux-g++ COLLECT_LTO_WRAPPER=/home/pawels/dvm/master/toolchain/gcc/sysroot/x86_64-gnu-linux/bin/../lib64/gcc/x86_64-gnu-linux/4.9.1/lto-wrapper Target: x86_64-gnu-linux Configured with: ../configure --target=x86_64-gnu-linux --with-arch=x86-64 --prefix=/home/pawels/toolchain.git/gcc/sysroot/x86_64-gnu-linux --with-sysroot=/home/pawels/toolchain.git/gcc/sysroot/x86_64-gnu-linux --libdir=/home/pawels/toolchain.git/gcc/sysroot/x86_64-gnu-linux/lib64 --libexecdir=/home/pawels/toolchain.git/gcc/sysroot/x86_64-gnu-linux/lib64 --with-slibdir=/home/pawels/toolchain.git/gcc/sysroot/x86_64-gnu-linux/lib64 --with-gmp-include=/home/pawels/toolchain.git/gcc/x86_64-gnu-linux/gcc-math-runtime/include --with-gmp-lib=/home/pawels/toolchain.git/gcc/x86_64-gnu-linux/gcc-math-runtime/lib --with-mpfr-include=/home/pawels/toolchain.git/gcc/x86_64-gnu-linux/gcc-math-runtime/include --with-mpfr-lib=/home/pawels/toolchain.git/gcc/x86_64-gnu-linux/gcc-math-runtime/lib --with-mpc-include=/home/pawels/toolchain.git/gcc/x86_64-gnu-linux/gcc-math-runtime/include --with-mpc-lib=/home/pawels/toolchain.git/gcc/x86_64-gnu-linux/gcc-math-runtime/lib --with-linker-hash-style=both --disable-multilib --enable-nls --disable-libssp --disable-libquadmath --disable-libitm --enable-tls --enable-libstdcxx-allocator=new --enable-extern-template --enable-libstdcxx-time=rt --enable-libstdcxx-threads --enable-symvers=gnu-versioned-namespace --disable-libstdcxx-pch --enable-lto --enable-plugin --enable-c99 --enable-long-long --enable-linux-futex --enable-threads=posix --enable-shared --with-pic --enable-gold --enable-libgomp --enable-__cxa_atexit --disable-initfini-array --disable-gnu-unique-object --enable-languages=c,c++ --enable-checking=release --with-long-double-128 --disable-cld --disable-bootstrap Thread model: posix gcc version 4.9.1 20140505 (prerelease) (GCC)