请教关于Boost和STLport两个库的问题

linwendong1982 2013-02-05 09:49:32
最近写了一个小程序,程序用到了boost库和stlport库。但是编译时候,出现了很多错误,一直困扰我解决不了。因为boost里用到了std的个别函数,编译时候就会去stlport库里找,搞得挺乱的。有使用经验的朋友请帮忙指导指导。谢谢。

error C2039: 'localtime' : is not a member of 'stlpd_std'
error C2660: 'boost::date_time::c_time::localtime' : function does not take 1 arguments
error C2039: 'gmtime' : is not a member of 'stlpd_std'
error C2660: 'boost::date_time::c_time::gmtime' : function does not take 1 arguments
error C2039: 'abort' : is not a member of 'stlpd_std'
error C3861: 'abort': identifier not found
error C2039: 'bad_alloc' : is not a member of 'stlpd_std'
error C3861: 'bad_alloc': identifier not found
error C2039: 'localtime' : is not a member of 'stlpd_std'
error C2660: 'boost::date_time::c_time::localtime' : function does not take 1 arguments
error C2039: 'gmtime' : is not a member of 'stlpd_std'
error C2660: 'boost::date_time::c_time::gmtime' : function does not take 1 arguments
error C2039: 'abort' : is not a member of 'stlpd_std'
error C3861: 'abort': identifier not found
error C2039: 'bad_alloc' : is not a member of 'stlpd_std'
error C3861: 'bad_alloc': identifier not found
error C2039: 'abort' : is not a member of 'stlpd_std'
error C3861: 'abort': identifier not found
error C2039: 'localtime' : is not a member of 'stlpd_std'
error C2660: 'boost::date_time::c_time::localtime' : function does not take 1 arguments
error C2039: 'gmtime' : is not a member of 'stlpd_std'
error C2664: 'boost::throw_exception' : cannot convert parameter 1 from 'boost::numeric::negative_overflow' to 'const stlpd_std::exception &'
1> Reason: cannot convert from 'boost::numeric::negative_overflow' to 'const stlpd_std::exception'
1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
error C2664: 'boost::throw_exception' : cannot convert parameter 1 from 'boost::numeric::positive_overflow' to 'const stlpd_std::exception &'
1> Reason: cannot convert from 'boost::numeric::positive_overflow' to 'const stlpd_std::exception'
1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>.\RainbowKeyImpl.cpp(58) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
...全文
128 7 点赞 打赏 收藏 举报
写回复
7 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
使用的时候怎么用的? 是否加入了include和using namespace xxx;?
  • 打赏
  • 举报
回复
linwendong1982 2013-02-05
我感觉编译选项和一些预编译宏来避免冲突。安装应该没问题的。
  • 打赏
  • 举报
回复
zhcosin 2013-02-05
stlport 好像是需要预先编译安装的,可能是你没安装正确。
  • 打赏
  • 举报
回复
chuachua66 2013-02-05
我的经验是,把两个库交叉的地方拆开,比如A类需要使用boost,把所有这些地方都抽出来做一个类B,然后B类包含boost的文件,类A包含类B的头,就没有问题了,不见面就没有冲突了。
  • 打赏
  • 举报
回复
linwendong1982 2013-02-05
已经折腾半天顺序了,没用。很郁闷。。。。。
  • 打赏
  • 举报
回复
赵4老师 2013-02-05
#include的顺序问题?
  • 打赏
  • 举报
回复
linwendong1982 2013-02-05
已在directories添加了引入的路径。
  • 打赏
  • 举报
回复
相关推荐
发帖
C++ 语言
加入

6.0w+

社区成员

C++ 语言相关问题讨论,技术干货分享,前沿动态等
申请成为版主
帖子事件
创建了帖子
2013-02-05 09:49
社区公告
暂无公告