Bug 60952 - Undefined references in vector<bool>
Undefined references in vector<bool>
Status: CLOSED NOTABUG
Product: Red Hat Raw Hide
Classification: Retired
Component: libstdc++ (Show other bugs)
1.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-03-10 07:03 EST by Stefan Sorensen
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-04-11 05:10:52 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Stefan Sorensen 2002-03-10 07:03:45 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.1.3 (X11; Linux i686; U;) Gecko/20020206

Description of problem:
Using vector<bool> generates undefined references to std::__WORD_BIT.

Version-Release number of selected component (if applicable):
libstdc++-3.1-0.22

How reproducible:
Always

Steps to Reproduce:
$ cat foo.cpp
#include <vector>
using std::vector;
int main(void)
{
    vector<bool> foo;
    foo.push_back(false);
    return 0;
}
$ gcc -o foo foo.cpp
/tmp/ccSGYSDG.o: In function `std::vector<bool, std::allocator<bool>
>::_M_insert_aux(std::_Bit_iterator, bool)':
/tmp/ccSGYSDG.o(.gnu.linkonce.t._ZNSt6vectorIbSaIbEE13_M_insert_auxESt13_Bit_iteratorb+0xd3):
undefined reference to `std::__WORD_BIT'
/tmp/ccSGYSDG.o(.gnu.linkonce.t._ZNSt6vectorIbSaIbEE13_M_insert_auxESt13_Bit_iteratorb+0x1cd):
undefined reference to `std::__WORD_BIT'
/tmp/ccSGYSDG.o(.gnu.linkonce.t._ZNSt6vectorIbSaIbEE13_M_insert_auxESt13_Bit_iteratorb+0x1dc):
undefined reference to `std::__WORD_BIT'
/tmp/ccSGYSDG.o: In function `std::_Bvector_alloc_base<std::allocator<bool>,
(bool)1>::_M_bit_alloc(unsigned)':
/tmp/ccSGYSDG.o(.gnu.linkonce.t._ZNSt19_Bvector_alloc_baseISaIbELb1EE12_M_bit_allocEj+0xa):
undefined reference to `std::__WORD_BIT'
/tmp/ccSGYSDG.o(.gnu.linkonce.t._ZNSt19_Bvector_alloc_baseISaIbELb1EE12_M_bit_allocEj+0x19):
undefined reference to `std::__WORD_BIT'
/tmp/ccSGYSDG.o: In function `std::__new_alloc::allocate(unsigned)':
/tmp/ccSGYSDG.o(.gnu.linkonce.t._ZNSt11__new_alloc8allocateEj+0xd): undefined
reference to `operator new(unsigned)'
/tmp/ccSGYSDG.o: In function `std::__new_alloc::deallocate(void*, unsigned)':
/tmp/ccSGYSDG.o(.gnu.linkonce.t._ZNSt11__new_alloc10deallocateEPvj+0xd):
undefined reference to `operator delete(void*)'
/tmp/ccSGYSDG.o: In function `std::operator-(std::_Bit_iterator_base const&,
std::_Bit_iterator_base const&)':
/tmp/ccSGYSDG.o(.gnu.linkonce.t._ZStmiRKSt18_Bit_iterator_baseS1_+0x15):
undefined reference to `std::__WORD_BIT'
/tmp/ccSGYSDG.o: In function `std::_Bit_iterator_base::_M_bump_up()':
/tmp/ccSGYSDG.o(.gnu.linkonce.t._ZNSt18_Bit_iterator_base10_M_bump_upEv+0x8):
undefined reference to `std::__WORD_BIT'
/tmp/ccSGYSDG.o: In function `std::_Bit_iterator_base::_M_bump_down()':
/tmp/ccSGYSDG.o(.gnu.linkonce.t._ZNSt18_Bit_iterator_base12_M_bump_downEv+0x13):
undefined reference to `std::__WORD_BIT'
/tmp/ccSGYSDG.o: In function `std::_Bit_iterator_base::_M_incr(int)':
/tmp/ccSGYSDG.o(.gnu.linkonce.t._ZNSt18_Bit_iterator_base7_M_incrEi+0x1b):
undefined reference to `std::__WORD_BIT'
/tmp/ccSGYSDG.o(.gnu.linkonce.t._ZNSt18_Bit_iterator_base7_M_incrEi+0x2f):
undefined reference to `std::__WORD_BIT'
/tmp/ccSGYSDG.o(.gnu.linkonce.t._ZNSt18_Bit_iterator_base7_M_incrEi+0x40): more
undefined references to `std::__WORD_BIT' follow
/tmp/ccSGYSDG.o(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
Comment 1 Jakub Jelinek 2002-04-11 05:40:32 EDT
Operator error. Either you need to add -lstdc++ explicitely, or link
using g++, not gcc.
Furthermore, 3.1-0.22 is pretty outdated, try a newer one like 3.1-0.24.

Note You need to log in before you can comment on or make changes to this bug.