Windows application fails to compile when including boost/process/v2.hpp

Open
#429 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
cpp

Research direction

Reproduce the failure with boost/process/v2.hpp in a minimal VS 2022 64-bit project using Boost 1.86 from vcpkg on Windows. Start by reading boost/process/v2/detail/utf8.hpp and boost/asio/detail/socket_types.hpp alongside the reported compiler errors. Done means the minimal application includes the v2 header and compiles without either error.

Written by the indexing model from the issue text.

Description

I'm upgrading my application from using

#include <boost/process.hpp>

to using the new boost process v2 stuff by using

#include <boost/process/v2.hpp>

When I do this, I get the following compile errors in Visual Studio 2022...

boost\process\v2\detail\utf8.hpp(28,47): error C2491: 'boost::process::v2::detail::conv_string': definition of dllimport function not allowed
boost\asio\detail\socket_types.hpp(24,1): fatal error C1189: #error: WinSock.h has already been included

Any ideas why I'm getting these errors? I've tried different things from previous issues posted but no success so far.

I'm using VS 2022 64-bit running on Windows 11. I'm also using boost::process version 1.86 built with vcpkg

Dominant language
C++
Stars
145
Forks
151
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/process

All issues in boostorg/process

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.