0

我正在尝试在 Visual Studio 2010 中运行生产者-消费者代码。我从下面的位置复制了代码

http://www.dailyfreecode.com/code/producer-consumer-problem-thread-1105.aspx#

我的操作系统是 windows (64bit) 我已经从下面的位置下载了所需的 pthread dll、lib 和包含文件夹用于 WINDOWS ..

 ftp://sourceware.org/pub/pthreads-win32/

我可以通过 Visual Studio 2010 的项目属性窗口添加包含和库路径。但是我没有找到通过 c++ 项目的属性窗口添加额外 dll 的选项。我的代码库出现以下错误:

error LNK2019: unresolved external symbol __imp__pthread_join referenced in function _main
error LNK2019: unresolved external symbol __imp__pthread_create referenced in function _main
error LNK2019: unresolved external symbol __imp__pthread_cond_signal referenced in function "void * __cdecl Producer(void)" (?Producer@@YAPAXXZ)
error LNK2019: unresolved external symbol __imp__pthread_mutex_unlock referenced in function "void * __cdecl Producer(void)" (?Producer@@YAPAXXZ)
error LNK2019: unresolved external symbol __imp__pthread_cond_wait referenced in function "void * __cdecl Producer(void)" (?Producer@@YAPAXXZ)
error LNK2019: unresolved external symbol __imp__pthread_mutex_lock referenced in function "void * __cdecl Producer(void)" (?Producer@@YAPAXXZ)

如何解决这个问题呢 ...

4

0 回答 0