【发布时间】:2009-08-27 22:17:19
【问题描述】:
我是使用 boost 的新手,但遇到了问题。我的项目中需要 shared_mutex 函数。所以我已经完成了
#include "boost/thread/shared_mutex.hpp"
并编译了我的项目。我的带有“将警告视为错误”的 MSVC 2005 由于出现警告而停止编译:
c:\\...\microsec_time_clock.hpp(103) : warning C4244: 'argument' : conversion from 'int' to 'unsigned short', possible loss of data
我不知道,为什么 shared_mutex 需要微秒函数(我读过比 boost 库有相当大的依赖列表),但我无法编译我的项目。我google了一下,发现同样的问题,但没有决定。
更新:我现在正在编译 boost,但我想将所有源代码放入我的开源项目,包括 boost.thread.shared_mutex。
【问题讨论】:
-
发布 boost 的版本号可能会有所帮助。它可以在 boost/version.hpp 中定义的宏 BOOST_LIB_VERSION 中找到
-
抱歉,我已经发布了我的编译器,但忘记了提升。我有最新的 (1.40.0) 版本。
-
什么样的代码?我做#include“boost/thread/shared_mutex.hpp”并在microsec_time_clock.hpp中的某处收到警告。
date_type d(curr_ptr->tm_year + 1900, curr_ptr->tm_mon + 1, curr_ptr->tm_mday);^ 这里。 -
不包含
shared_mutex时它会消失? -
是的,因为共享互斥锁是我使用的唯一一个 boost lib。
标签: c++ boost boost-thread