This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25107] New: undefined reference even though the template is instantiated
- From: "smirolo at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Nov 2005 18:26:37 -0000
- Subject: [Bug c++/25107] New: undefined reference even though the template is instantiated
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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