请教关于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
...全文
184 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
唯恐天下不乱 2013-02-05
  • 打赏
  • 举报
回复
使用的时候怎么用的? 是否加入了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添加了引入的路径。

65,186

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧