How to use pthred.h on Visual Studio 2022?

DONG KYUN AHN 0 Reputation points
2023-04-27T10:27:23.8966667+00:00

Hi,

I use Visual Studio 2022.

When I include pthread.h file, following error occurs.

How can resolve this?

I installed vcpkg but the same error occurs.

pthreadVC3.lib: No such file or directory ITS_Protocol C:\Users\adk82\source\repos\ITS_Protocol\ITS_Protocol\g++ 1 build Ld

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,752 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Tianyu Sun-MSFT 28,421 Reputation points Microsoft Vendor
    2023-04-27T13:46:09.0466667+00:00

    Hello @DONG KYUN AHN ,

    Welcome to Microsoft Q&A forum.

    Please try to close VS 2022 and run vcpkg install pthreads:x64-windows in an elevated Command Prompt. After that, launch VS and open your project, include pthread.h file again.

    Sincerely,

    Tianyu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    5 deleted comments

    Comments have been turned off. Learn more