Boost logo

Boost :

From: Paul Hamilton (paul_at_[hidden])
Date: 2003-08-17 11:30:10


This gives me problems:

   template<class Tr, class Ch> inline
   void empty_buf(BOOST_IO_STD basic_ostringstream<Ch,Tr> & os) {
     static const std::basic_string<Ch, Tr> emptyStr;
     os.str(emptyStr);
   }

When I use something that includes this in two different dll's, and
then try to link them into another exe (or dll), I get a problem with
duplicate symbols.

It's usually a bad idea to declare a global variable as part of a
library, without specifying some way of providing the actual definition
of it a single time.

What is the work around apart from wrapping all of the boost functions
in another library?

I'm working on OS X, so maybe it's specific to that platform.

Paul.

---------------------
Paul Hamilton
pHamtec P/L - Software Makers
http://www.phamtec.com/
mailto:paul_at_[hidden]

The information transmitted is intended only for the person or entity
to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you
received this in error, please contact the sender and delete the
material from any computer.
-----------------------------------------------------


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk