|
Boost : |
From: Robert Ramey (ramey_at_[hidden])
Date: 2007-01-04 18:30:56
Method I
Make your function "inline" either explicitly or by including
the definition in the member function declaration.
This is not my favorite method.
leave the declarations in the header - but move the definitions
to a *.cpp file. Use explicit instantiation to generate code
for all the archives you plan to use or for polymorphic archive.
This is my preferred method.
Robert Ramey
Deane Yang wrote:
> Hello,
>
> I am using the CVS version tagged RC_1_34_0.
>
> I put all the BOOST_CLASS_EXPORT statements into a header file that
> also contains all the serialization functions. This header is
> included by two separate .cpp files, each of which implements the
> loading and saving of archives for a different subset of the classes
> that can be serialized.
>
> These are all compiled into a single DLL.
>
> All of this compiles under VC8.0 (but I have not yet verified that it
> runs properly).
>
> But when linking with gcc (in Linux), I get multiple definition errors
> when linking.
>
> What's the best way to deal with this? (assuming that this is a
> problem
> that you recognize and know how to fix)
>
> Deane
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk