serialization tests on msvc in develop

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

serialization tests on msvc in develop

Robert Ramey
I've been having a heck of a time getting the right "visibility"
attributes set for all environments in the serialization library.

The library doesn't build on msvc and an attempt to retrieve the syntax
error retrieves a long message.  The message gets truncated before
reaching the good part.

People have helped me in the past - please don't stop now.

Robert Ramey

_______________________________________________
Boost-Testing mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-testing
Reply | Threaded
Open this post in threaded view
|

Re: serialization tests on msvc in develop

Marcel Raad
This post has NOT been accepted by the mailing list yet.
Robert Ramey wrote
The library doesn't build on msvc and an attempt to retrieve the syntax
error retrieves a long message.  The message gets truncated before
reaching the good part.

People have helped me in the past - please don't stop now.
As mentioned on this commit:
boostorg/serialization/commit/e4b18d93794841a1598b043f3fc153ad81ee8ba5

BOOST_SERIALIZATION_SOURCE just has to be defined before the boost/serialization/config.hpp include instead of after it, then all configurations build for me with MSVC 14.

The relevant compiler error is:
Error C2491: Definition of dllimport function not allowed

This is because BOOST_SERIALIZATION_DECL is defined as BOOST_SYMBOL_IMPORT instead of
BOOST_SYMBOL_EXPORT in boost/serialization/config.hpp if BOOST_SERIALIZATION_SOURCE is not defined.
Reply | Threaded
Open this post in threaded view
|

Re: serialization tests on msvc in develop

John Maddock-2
In reply to this post by Robert Ramey


On 11/11/2015 21:41, Robert Ramey wrote:
> I've been having a heck of a time getting the right "visibility"
> attributes set for all environments in the serialization library.
>
> The library doesn't build on msvc and an attempt to retrieve the syntax
> error retrieves a long message.  The message gets truncated before
> reaching the good part.
>
> People have helped me in the past - please don't stop now.
>

This one I don't understand, in:

  void wchar_from_mb<Base>::drain(),

the assertion:

     BOOST_ASSERT(std::codecvt_base::ok == r);

Fails as the result of the conversion is "partial".

With regard to the dll build issue: there are a whole bunch of files
where you include #include <boost/serialization/config.hpp> *before*
setting BOOST_SERIALIZATION_SOURCE.  As a result
BOOST_SERIALIZATION_DECL is set to dllimport before
BOOST_SERIALIZATION_SOURCE is ever defined.  You need to make sure
#define BOOST_SERIALIZATION_SOURCE is right at the top of all the source
files - before any #includes.

HTH, John.




_______________________________________________
Boost-Testing mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-testing
Reply | Threaded
Open this post in threaded view
|

Re: serialization tests on msvc in develop

Robert Ramey
On 11/12/15 3:07 AM, John Maddock wrote:

>
>
> On 11/11/2015 21:41, Robert Ramey wrote:
>> I've been having a heck of a time getting the right "visibility"
>> attributes set for all environments in the serialization library.
>>
>> The library doesn't build on msvc and an attempt to retrieve the syntax
>> error retrieves a long message.  The message gets truncated before
>> reaching the good part.
>>
>> People have helped me in the past - please don't stop now.
>>
>
> This one I don't understand, in:
>
>   void wchar_from_mb<Base>::drain(),
>
> the assertion:
>
>      BOOST_ASSERT(std::codecvt_base::ok == r);
>
> Fails as the result of the conversion is "partial".
>
> With regard to the dll build issue: there are a whole bunch of files
> where you include #include <boost/serialization/config.hpp> *before*
> setting BOOST_SERIALIZATION_SOURCE.  As a result
> BOOST_SERIALIZATION_DECL is set to dllimport before
> BOOST_SERIALIZATION_SOURCE is ever defined.  You need to make sure
> #define BOOST_SERIALIZATION_SOURCE is right at the top of all the source
> files - before any #includes.

I'm not sure that it's that simple.

code in wserialization.dll makes calls in serialization.dll.  So the
#includes for imported functions have to be be fore the "SOURCE"
statements.  I originally did this a number of years ago and don't
remember whether or not it was painful.  I recently mucked things up on
implementing the "visibility" features of gcc and clang.  So now I'm
dependent on three subtlely different sets of rules.  I know they are
all similar but slightly different so it means experimentation to get it
right.  And of course I no longer have an MSVC compiler at my ready
disposal.  And of course this isn't helped by the fact that when the
library fails to build on the boost test matrix - the error messages are
truncated.

Robert Ramey

>
> HTH, John.

_______________________________________________
Boost-Testing mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-testing