简体   繁体   中英

Using pthread in c++ on Visual Studio 2013

I am trying to use the pthread library on windows. I downloaded a zip with a Pre-built.2 folder in it and followed the instruction.

What I have done so far:

  • all .h files from POSIX\\Pre-built.2\\include into MS VS2013\\VC\\include folder
  • all .dll files from \\dll\\x86dll\\x86 into VC\\bin
  • all .lib files from lib\\x86 into VC\\lib
  • In Property->Config->Linker->Input->Additional Dependencies , pthreadVC2.lib;pthreadVCE2.lib;pthreadVSE2.lib;%(AdditionalDependencies) // pthread.lib already in Inherited values

I included pthread.h inside my program and when trying to build solution, the following error appears:

Error   1   error LNK1104: cannot open file 'pthread.lib'

Can anyone help me out? Thanks.

EDIT:

The Include Directories and Library Directories are

A:\Program Files %28x86%29\Microsoft Visual Studio 12.0\VC\include;$(IncludePath)

and

A:\Program Files %28x86%29\Microsoft Visual Studio 12.0\VC\lib;$(LibraryPath)

respectively now. But I still get the same error message.

包含 LIB的文件夹添加到Configuration Properties -> VC++ Directories -> Library Directories

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM