Skip to content

std::mutex problem on windows / msvc 2022 #1227

Description

@redhog

In my plugin (crowdsource_pi), I'm using std::mutex, and this failed on windows (MSVC 2022) with an access violation inside the mutex implementation.

After a lot of digging, I found the culprit to be a version incompatibility between the STL headers of MSVC 2022 and the version of msvcp140.dll, see this thread:

https://developercommunity.visualstudio.com/t/Visual-Studio-17100-Update-leads-to-Pr/10669759

I ended up using the workaround described there (defining _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR), but I assume this is a problem that might affect more people. I know too little of windows to be sure of the correct solution, but I'm assuming it would be either to distribute the correct version of msvcp140.dll with opencpn, or differentiating the builds for windows installs with different versions of that dll.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions