This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/15412] New: _GLIBCXX_ symbols symbols defined and used in different namespaces


This short program cannot build:

------------------------------------------------------------------
#include <memory>
#include <ext/pool_allocator.h>

int main()
{
   void* ptr = __gnu_cxx::__pool_alloc<true,0>::allocate(10);
   __gnu_cxx::__pool_alloc<true,0>::deallocate(ptr, 10);
}
------------------------------------------------------------------

A number of link errors will appear:

d:/mingw-gcc3.4/bin/../lib/gcc/mingw32/3.4.0/../../../libstdc++.a(allocator.o)
(.text$_ZN9__gnu_cxx12__pool_allocILb1ELi0EE5_LockC1Ev+0x31):allocator.cc: 
undefined reference to `__gnu_cxx::_GLIBCXX_mutex_address'
d:/mingw-gcc3.4/bin/../lib/gcc/mingw32/3.4.0/../../../libstdc++.a(allocator.o)
(.text$_ZN9__gnu_cxx12__pool_allocILb1ELi0EE5_LockC1Ev+0x4c):allocator.cc: 
undefined reference to `__gnu_cxx::_GLIBCXX_mutex'
d:/mingw-gcc3.4/bin/../lib/gcc/mingw32/3.4.0/../../../libstdc++.a(allocator.o)
(.text$_ZN9__gnu_cxx12__pool_allocILb1ELi0EE5_LockC1Ev+0x84):allocator.cc: 
undefined reference to `__gnu_cxx::_GLIBCXX_once'
d:/mingw-gcc3.4/bin/../lib/gcc/mingw32/3.4.0/../../../libstdc++.a(allocator.o)
(.text$_ZN9__gnu_cxx12__pool_allocILb1ELi0EE5_LockC1Ev+0x89):allocator.cc: 
undefined reference to `__gnu_cxx::_GLIBCXX_mutex_init()'
...

The cause is that libstdc++-v3/include/bits/stl_threads.h references these 
symbols in namespace `__gnu_cxx', and libstdc++-v3/src/globals_io.cc defines 
them in namespace `__gnu_internal'.  It seems to affect all platforms.

-- 
           Summary: _GLIBCXX_ symbols symbols defined and used in different
                    namespaces
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P1
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: adah at netstd dot com
                CC: dannysmith at clear dot net dot nz,gcc-bugs at gcc dot
                    gnu dot org
  GCC host triplet: mingw32
GCC target triplet: mingw32


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15412


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]