Cannot compile Boost JSON under Visual Studio 2022 with /clr

Kevin Frey via Boost-users <[email protected]> Wed, 5 Apr 2023 00:08:36 +0000
Newsgroups gmane.comp.lib.boost.user
Message-ID <010f01874ebe6fb6-a8b2d033-6153-4223-bc84-eea3989a06a2-000000@us-east-2.amazonses.com>
Hello Boosters,

I have a simple file to compile the Boost JSON source (Boost 1.81) to avoid creating a library:

#define BOOST_CONTAINER_NO_LIB

#include "boost\json\src.hpp"


This works fine on X86 and X64 builds, but when I try a .NET /clr compile, I get errors coming out of parser.ipp and a few other places, all of this type:

Error C2679 binary '=': no operator found which takes a right-hand operand of type 'boost::json::error_code' (or there is no acceptable conversion)

The code producing the error is trying to convert the boost::system::error_code to a std::error_code, via a simple assignment, so clearly relying on a conversion operator.

It appears that the conversion to std::error_code is conditionally included based on the BOOST_SYSTEM_HAS_SYSTEM_ERROR macro, but if I manually define this macro I get a whole lot of other errors instead (mainly relating to Mutex).

Is this a bug in the library, or a misconfiguration on my part in order to compile correctly for /clr?

Thanks in advance

Kevin

_______________________________________________
Boost-users mailing list
[email protected]
https://lists.boost.org/mailman/listinfo.cgi/boost-users