1

I know this question was asked here: Issue with exporting a class with standard mutex member

But I am wondering if someone could explain to me a skeletal idea of a workaround (like should I build my own mutex class?) or give me a good jump off point of where to look to re-write my code to prevent this error? I am getting an error similar to the gentleman who posted the question in the link above with an analogous setup to him, so just for the sake of example, I will paste his code and warning:

    class WGTKERNELKERNELSERVICES_API CPSCalHelper
{
    mutex m_RampVoltageMutex;
};

warning C4251: 'CPSCalHelper::m_RampVoltageMutex': class 'std::mutex' needs to have dll-interface to be used by clients of class 'CPSCalHelper'

Any help would be appreciated, even a link or a note about what else I should be researching would help, because I haven't been able to find much relevant in that department...

Thanks!

interjay
  • 107,303
  • 21
  • 270
  • 254
ccm
  • 11
  • 2
  • Have a read of the __Remarks__ section https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4251?view=msvc-160 – Richard Critten May 06 '21 at 13:53

0 Answers0