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++/25107] New: undefined reference even though the template is instantiated


I get a different behavior when compiling on powerpc/MacOSX 10.3.9 and
i686/Linux. In the first case,
the symbol is undefined while in the second case it is weak and thus link
correctly.

#include <iostream>
#include "boost/dynamic_bitset.hpp"

int main( int argc, char *argv[] )
{
  boost::dynamic_bitset<> aDynBitset;
  std::cout << aDynBitset.count() << std::endl;
  return 0;
}

g++ -v --save-temps -I${HOME}/installed/local/include -o test_dynamic_bitset
test_dynamic_bitset.cc > test_dynamic_bitset.log 2>&1 

 'nm test_dynamic_bitset.o' outputs
 On MacOSX:
         U boost::detail::dynamic_bitset_count_impl::count_table<true>::table
 On linux:
         00000000 V
boost::detail::dynamic_bitset_count_impl::count_table<true>::table

I would expect the behavior to be the same on both systems, mostly the same as
on linux.


-- 
           Summary: undefined reference even though the template is
                    instantiated
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: smirolo at hotmail dot com
  GCC host triplet: powerpc-darwin
GCC target triplet: powerpc-darwin


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


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