【发布时间】:2014-06-27 11:44:30
【问题描述】:
这是我在使用线程构建简单代码时遇到的错误。
1>------ Rebuild All started: Project: Sample_with_Threads, Configuration: Debug Win32 ------
1> source.cpp
1>c:\users\documents\visual studio 2010\projects\sample_with_threads\source.cpp(39): warning C4715: 'set_cur_avg' : not all control paths return a value
1>LINK : fatal error LNK1104: cannot open file 'pthreadsVC2.lib'
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
我使用 Visual C++,并按照 http://web.cs.du.edu/~sturtevant/pthread.html 在其中包含 pthreads。
为什么会出现错误,解决方法是什么?
【问题讨论】: