【发布时间】:2014-07-17 09:42:29
【问题描述】:
我在 VS 2010 中使用 boost 1_53 进行编译。 我也在使用boost的线程。
在编译过程中我遇到了一堆这样的错误
c:\program files (x86)\microsoft visual studio 10.0\vc\include\ctime(18): error C2039: 'clock_t' : is not a member of '`global namespace''
所有错误都与ctime和c_time.hpp有关。
我已经四处寻找解决方案,但没有成功。
有人可以帮忙吗?
这里是部分代码。
#define BOOST_THREAD_USE_DLL
#include <boost/optional.hpp>
#include <boost/thread.hpp>
#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
【问题讨论】:
-
如果您将
<ctime>包含为<time.h>,您可能会无意中包含一个完全不同的文件,具体取决于您的包含路径。 -
您遇到的第一个错误是什么?其余的可能只是附带损害。
-
这里是第一个错误:c:\program files (x86)\microsoft visual studio 10.0\vc\include\ctime(18): error C2039: 'clock_t' : is not a member of ' `全局命名空间''
-
@mikners 你能发一个SSCCE吗?
-
@Theolodis:我怀疑这是否相关。链接器错误 编译器错误。
标签: c++ boost compiler-errors ctime