c++ - 在 Visual Studio 2013 上的 C++ 中使用 pthread

标签 c++ windows visual-studio-2013 pthreads

我正在尝试在 Windows 上使用 pthread 库。我下载了一个带有 Pre-built.2 文件夹的 zip,然后按照说明进行操作。

到目前为止我做了什么:

  • POSIX\Pre-built.2\include 中的所有 .h 文件放入 MS VS2013\VC\include 文件夹中
  • \dll\x86dll\x86 中的所有 .dll 文件到 VC\bin
  • lib\x86 中的所有 .lib 文件到 VC\lib
  • Property->Config->Linker->Input->Additional Dependencies中,pthreadVC2.lib;pthreadVCE2.lib;pthreadVSE2.lib;%(AdditionalDependencies)//pthread.lib 已经在 Inherited values 中

我将 pthread.h 包含在我的程序中,当尝试构建解决方案时,出现以下错误:

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

谁能帮帮我?谢谢。

编辑:

Include DirectoriesLibrary Directories

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

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

分别现在。但我仍然收到相同的错误消息。

最佳答案

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

关于c++ - 在 Visual Studio 2013 上的 C++ 中使用 pthread,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28369973/

相关文章:

c++ - 在调用基类之前需要调用成员的方法

c++ - 在 Windows 上将 Boost 库与 Boost_USE_STATIC_LIB OFF 链接

asp.net - Visual Studio 2013 不会显示设计 View

c++ - 在后台持续运行 windows phone 8.1 应用程序

c++ - 获取 vector 的尾部?

python - 为什么在 dask 中运行 .compute() 导致 "Fatal Python error: GC object already tracked"

php - 带有 Xampp 错误的符号链接(symbolic link)

windows - Git svn 不使用 svn 凭据

visual-studio-2013 - 成功构建, typescript 输入文件中有许多错误

c++ - 在成员初始化器列表中,我可以创建对不在列表中的成员变量的引用吗?