Boost logo

Boost :

From: Tim Blechmann (TimBlechmann_at_[hidden])
Date: 2006-04-19 10:29:43

hi all,

currently it's not possible to include boost/plugin.hpp or
boost/plugin/virtual_constructors.hpp from different object files
with gcc-3.4.6

including plugin.hpp from two object files:
tim_at_laptop ~/sandbox $ g++ main.cpp t1.o t2.o
t2.o: In function
t1.cpp:(.text+0x0): multiple definition of
`boost::dynamic_visitor_base::~dynami c_visitor_base()'
t1.o:t1.cpp:(.text+0x0): first defined here
t2.o: In function
t1.cpp:(.text+0x28): multiple definition of
`boost::dynamic_visitor_base::~dynam ic_visitor_base()'
t1.o:t1.cpp:(.text+0x28): first defined here
t2.o: In function
t1.cpp:(.text+0x50): multiple definition of
`boost::dynamic_visitor_base::~dynam ic_visitor_base()'
t1.o:t1.cpp:(.text+0x50): first defined here
t2.o:(.bss+0x0): multiple definition of `(anonymous namespace)::_1'
t1.o:(.bss+0x0): first defined here
t2.o:(.bss+0x1): multiple definition of `(anonymous namespace)::_2'
t1.o:(.bss+0x1): first defined here
t2.o:(.bss+0x2): multiple definition of `(anonymous namespace)::_3'
t1.o:(.bss+0x2): first defined here
t2.o:(.bss+0x3): multiple definition of `(anonymous namespace)::_4'
t1.o:(.bss+0x3): first defined here
t2.o:(.bss+0x4): multiple definition of `(anonymous namespace)::_5'
t1.o:(.bss+0x4): first defined here
t2.o:(.bss+0x5): multiple definition of `(anonymous namespace)::_6'
t1.o:(.bss+0x5): first defined here
t2.o:(.bss+0x6): multiple definition of `(anonymous namespace)::_7'
t1.o:(.bss+0x6): first defined here
t2.o:(.bss+0x7): multiple definition of `(anonymous namespace)::_8'
t1.o:(.bss+0x7): first defined here
t2.o:(.bss+0x8): multiple definition of `(anonymous namespace)::_9'
t1.o:(.bss+0x8): first defined here
collect2: ld returned 1 exit status

t1.cpp & t2.cpp contain:
#include "boost/plugin.hpp"

main.cpp contains:
int main(){return 0;}

similar things happen with boost/plugin/virtual_constructors.hpp ...

not sure, if it's a but in the library, or a compiler bug ...

cheers ... tim

TimBlechmann_at_[hidden]    ICQ: 96771783
You can play a shoestring if you're sincere
  John Coltrane

Boost list run by bdawes at, gregod at, cpdaniel at, john at