Boost logo

Boost Users :

From: Sohail Somani (sohail_at_[hidden])
Date: 2008-04-13 18:02:08


Dan Thill wrote:
> Dan Thill wrote:
>>> Is it a possibility that the linker is not linking in the
>>> guid_initializer code? For this particular build type, I'm not even
>>> doing optimizations... let alone link-time code generation. This is
>>> on MSVC80.
>> Hm. The MSVC debugger isn't letting me set breakpoints in any of my
>> serialization code, saying "This breakpoint won't be hit. No symbols
>> have been loaded for this document"
>>
>> I know that the serialization code is being generated in the static
>> library (compilation times are lengthy) and that library is specified on
>> the linker commandline. But after that...
>
> To reply to myself once more...
>
> Yes, this is the problem. I put a breakpoint at
> extended_type_info_typeid.hpp:96, and it is not being called for any
> types which I serialize *only* via base class pointer. For types that
> are serialized through most-derived pointer (sharing the same base as
> the others), an extended_type_info_typeid_1<T> is getting created for
> each one.

Hey Dan,

I think the problem is that you are using a static library which
contains the serialization code. Static libraries are notorious for not
linking code that is never directly called. So the solution is to
include the object files contained in your static library into your
executable/dll. For Visual C++, there is no command line linker option
as I understand it. On gcc, you can do g++ -Wl,--whole-archive if memory
serves (which I'm sure it doesn't)

-- 
Sohail Somani
http://uint32t.blogspot.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net