Boost Fibers Compiler Error (definition of dllimport function not allowed)

51 Views Asked by At

With the current version of Visual Studio Community (Version 17.8.6) and the current version of VCPKG (2023-12-12-1c9ec1978a6b0c2b39c9e9554a96e3e275f7556e) I have just started getting a compiler error that was not present before. I verified that with VS Community 17.8.5 and a slightly older cut of VCPKG, this error is not present.

(VCPKG was configured to build with the default x64-windows triplet. Nothing special was done there. My project is attempting to compile a DLL.)

The full error message is:

vcpkg_installed\x64-windows\include\boost\fiber\stack_allocator_wrapper.hpp(85,43): error C2491: 'boost::fibers::make_stack_allocator_wrapper': definition of dllimport function not allowed

This seems to be due to make_stack_allocator_wrapper attempting to export a templated function:

From boost\fiber\stack_allocator_wrapper.hpp:

template <typename StackAllocator, typename ... Args>
BOOST_FIBERS_DECL stack_allocator_wrapper make_stack_allocator_wrapper(Args && ... args)
{
    return stack_allocator_wrapper(
            std::unique_ptr<detail::polymorphic_stack_allocator_base>(
                new detail::polymorphic_stack_allocator_impl<StackAllocator>(std::forward< Args >( args) ... )));
}

Has anyone else seen this or determined if this needs patched or otherwise has a way to correct it from client (my) code or CMake configuration?

0

There are 0 best solutions below