Boost::xpressive在Vxworks6.4下编译不过去,求助

guolisen 2011-05-28 03:24:43
Boost::xpressive在Vxworks6.4下编译不过去,求助

Vxworks6.4使用的是ccppc (GCC) 3.4.4 ,看文档也支持GNU C++ 3.4 and higher
编译文档里面第一个例子就编不过去,后来发现只要是sregex相关就编不过去,cregex却可以使用,是为什么呢,请教高手啊
后来用Vxworks6.8的编译器编译,使用的是G++ 4.1情况一样,推断可能是stl不兼容,不知道STLPort是否可以交叉编译成库


#include <iostream>
#include <boost/xpressive/xpressive.hpp>

using namespace boost::xpressive;

int main()
{
std::string hello( "hello world!" );

sregex rex = sregex::compile( "(\\w+) (\\w+)!" );
smatch what;

if( regex_match( hello, what, rex ) )
{
std::cout << what[0] << '\n'; // whole match
std::cout << what[1] << '\n'; // first capture
std::cout << what[2] << '\n'; // second capture
}

return 0;
}


...全文
211 7 打赏 收藏 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
guolisen 2011-05-29
  • 打赏
  • 举报
回复
搞定了,是boost里面有一个命名和vector冲突,谢
guolisen 2011-05-28
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 taodm 的回复:]

boost库绝对不是一个“简单的小工具”,而是“复杂的庞大系统”,嵌入系统上应该根本不予考虑。
[/Quote]

复杂的庞大系统其中的小工具,也不用把他想的这么崇高
taodm 2011-05-28
  • 打赏
  • 举报
回复
boost库绝对不是一个“简单的小工具”,而是“复杂的庞大系统”,嵌入系统上应该根本不予考虑。
guolisen 2011-05-28
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 taodm 的回复:]

太狠了,vxworks上使用boost库。
[/Quote]

做一下尝试,而且简单的小工具用一用也没有坏处,当然移植的问题隐患比较大,所以先把能用的库摸索一下,呵呵
guolisen 2011-05-28
  • 打赏
  • 举报
回复
c:\windriver\gnu\3.4.4-vxworks-6.4\x86-win32\bin\../lib/gcc/powerpc-wrs-vxworks/3.4.4/../../../../include/c++/3.4.4/vector: In member function `void std::vector<_Ty, _Ax>::_Insert_n(std::vector<_Ty, _
Ax>::iterator, typename std::_Vector_val<_Ty, _Ax>::_Alty::size_type, const _Ty&) [with _Ty = boost::xpressive::detail::shared_matchable<std::basic_string<char, std::char_traits<char>, std::allocator<
char> >::const_iterator>, _Ax = std::allocator<boost::xpressive::detail::shared_matchable<std::basic_string<char, std::char_traits<char>, std::allocator<char> >::const_iterator> >]':
c:\windriver\gnu\3.4.4-vxworks-6.4\x86-win32\bin\../lib/gcc/powerpc-wrs-vxworks/3.4.4/../../../../include/c++/3.4.4/vector:719: instantiated from `std::vector<_Ty, _Ax>::iterator std::vector<_Ty, _A
x>::insert(std::vector<_Ty, _Ax>::iterator, const _Ty&) [with _Ty = boost::xpressive::detail::shared_matchable<std::basic_string<char, std::char_traits<char>, std::allocator<char> >::const_iterator>,
_Ax = std::allocator<boost::xpressive::detail::shared_matchable<std::basic_string<char, std::char_traits<char>, std::allocator<char> >::const_iterator> >]'
c:\windriver\gnu\3.4.4-vxworks-6.4\x86-win32\bin\../lib/gcc/powerpc-wrs-vxworks/3.4.4/../../../../include/c++/3.4.4/vector:665: instantiated from `void std::vector<_Ty, _Ax>::push_back(const _Ty&) [
with _Ty = boost::xpressive::detail::shared_matchable<std::basic_string<char, std::char_traits<char>, std::allocator<char> >::const_iterator>, _Ax = std::allocator<boost::xpressive::detail::shared_mat
chable<std::basic_string<char, std::char_traits<char>, std::allocator<char> >::const_iterator> >]'
D:/code/boost_1_46_1/boost/xpressive/detail/dynamic/sequence.hpp:112: instantiated from `boost::xpressive::detail::sequence<BidiIter>& boost::xpressive::detail::sequence<BidiIter>::operator|=(boost:
:xpressive::detail::sequence<BidiIter>) [with BidiIter = std::basic_string<char, std::char_traits<char>, std::allocator<char> >::const_iterator]'
D:/code/boost_1_46_1/boost/xpressive/regex_compiler.hpp:287: instantiated from `boost::xpressive::detail::sequence<BidiIter> boost::xpressive::regex_compiler<BidiIter, RegexTraits, CompilerTraits>::
parse_alternates(FwdIter&, FwdIter) [with FwdIter = const char*, BidiIter = std::basic_string<char, std::char_traits<char>, std::allocator<char> >::const_iterator, RegexTraits = boost::xpressive::rege
x_traits<char, boost::xpressive::cpp_regex_traits<char> >, CompilerTraits = boost::xpressive::compiler_traits<boost::xpressive::regex_traits<char, boost::xpressive::cpp_regex_traits<char> > >]'
D:/code/boost_1_46_1/boost/xpressive/regex_compiler.hpp:212: instantiated from `boost::xpressive::basic_regex<BidiIter> boost::xpressive::regex_compiler<BidiIter, RegexTraits, CompilerTraits>::compi
le_(FwdIter, FwdIter, boost::xpressive::regex_constants::syntax_option_type, std::forward_iterator_tag) [with FwdIter = const char*, BidiIter = std::basic_string<char, std::char_traits<char>, std::all
ocator<char> >::const_iterator, RegexTraits = boost::xpressive::regex_traits<char, boost::xpressive::cpp_regex_traits<char> >, CompilerTraits = boost::xpressive::compiler_traits<boost::xpressive::rege
x_traits<char, boost::xpressive::cpp_regex_traits<char> > >]'
D:/code/boost_1_46_1/boost/xpressive/regex_compiler.hpp:120: instantiated from `boost::xpressive::basic_regex<BidiIter> boost::xpressive::regex_compiler<BidiIter, RegexTraits, CompilerTraits>::compi
le(InputIter, InputIter, boost::xpressive::regex_constants::syntax_option_type) [with InputIter = const char*, BidiIter = std::basic_string<char, std::char_traits<char>, std::allocator<char> >::const_
iterator, RegexTraits = boost::xpressive::regex_traits<char, boost::xpressive::cpp_regex_traits<char> >, CompilerTraits = boost::xpressive::compiler_traits<boost::xpressive::regex_traits<char, boost::
xpressive::cpp_regex_traits<char> > >]'
D:/code/boost_1_46_1/boost/xpressive/regex_compiler.hpp:139: instantiated from `boost::xpressive::basic_regex<BidiIter> boost::xpressive::regex_compiler<BidiIter, RegexTraits, CompilerTraits>::compi
le(const typename boost::iterator_value<Iterator>::type*, boost::xpressive::regex_constants::syntax_option_type) [with BidiIter = std::basic_string<char, std::char_traits<char>, std::allocator<char> >
::const_iterator, RegexTraits = boost::xpressive::regex_traits<char, boost::xpressive::cpp_regex_traits<char> >, CompilerTraits = boost::xpressive::compiler_traits<boost::xpressive::regex_traits<char,
boost::xpressive::cpp_regex_traits<char> > >]'
D:/code/boost_1_46_1/boost/xpressive/basic_regex.hpp:200: instantiated from `static boost::xpressive::basic_regex<BidiIter> boost::xpressive::basic_regex<BidiIter>::compile(const typename boost::ite
rator_value<Iterator>::type*, boost::xpressive::regex_constants::syntax_option_type) [with BidiIter = std::basic_string<char, std::char_traits<char>, std::allocator<char> >::const_iterator]'
testBoost.cpp:13: instantiated from here
D:/code/boost_1_46_1/boost/xpressive/detail/utility/sequence_stack.hpp:24: error: `boost::xpressive::detail::fill' is not a function,
c:\windriver\gnu\3.4.4-vxworks-6.4\x86-win32\bin\../lib/gcc/powerpc-wrs-vxworks/3.4.4/../../../../include/c++/3.4.4/xutility:1661: error: conflict with `void std::fill(unsigned char*, unsigned char*
, int)'
taodm 2011-05-28
  • 打赏
  • 举报
回复
太狠了,vxworks上使用boost库。
guolisen 2011-05-28
  • 打赏
  • 举报
回复


编译错误提示:


c:\windriver\gnu\3.4.4-vxworks-6.4\x86-win32\bin\../lib/gcc/powerpc-wrs-vxworks/3.4.4/../../../../include/c++/3.4.4/vector: In member function `void std::vector<_Ty, _Ax>::_Insert_n(std::vector<_Ty, _
Ax>::iterator, typename std::_Vector_val<_Ty, _Ax>::_Alty::size_type, const _Ty&) [with _Ty = boost::xpressive::detail::shared_matchable<std::basic_string<char, std::char_traits<char>, std::allocator<
char> >::const_iterator>, _Ax = std::allocator<boost::xpressive::detail::shared_matchable<std::basic_string<char, std::char_traits<char>, std::allocator<char> >::const_iterator> >]':
c:\windriver\gnu\3.4.4-vxworks-6.4\x86-win32\bin\../lib/gcc/powerpc-wrs-vxworks/3.4.4/../../../../include/c++/3.4.4/vector:719: instantiated from `std::vector<_Ty, _Ax>::iterator std::vector<_Ty, _A
x>::insert(std::vector<_Ty, _Ax>::iterator, const _Ty&) [with _Ty = boost::xpressive::detail::shared_matchable<std::basic_string<char, std::char_traits<char>, std::allocator<char> >::const_iterator>,
_Ax = std::allocator<boost::xpressive::detail::shared_matchable<std::basic_string<char, std::char_traits<char>, std::allocator<char> >::const_iterator> >]'
c:\windriver\gnu\3.4.4-vxworks-6.4\x86-win32\bin\../lib/gcc/powerpc-wrs-vxworks/3.4.4/../../../../include/c++/3.4.4/vector:665: instantiated from `void std::vector<_Ty, _Ax>::push_back(const _Ty&) [
with _Ty = boost::xpressive::detail::shared_matchable<std::basic_string<char, std::char_traits<char>, std::allocator<char> >::const_iterator>, _Ax = std::allocator<boost::xpressive::detail::shared_mat
chable<std::basic_string<char, std::char_traits<char>, std::allocator<char> >::const_iterator> >]'
D:/code/boost_1_46_1/boost/xpressive/detail/dynamic/sequence.hpp:112: instantiated from `boost::xpressive::detail::sequence<BidiIter>& boost::xpressive::detail::sequence<BidiIter>::operator|=(boost:
:xpressive::detail::sequence<BidiIter>) [with BidiIter = std::basic_string<char, std::char_traits<char>, std::allocator<char> >::const_iterator]'
D:/code/boost_1_46_1/boost/xpressive/regex_compiler.hpp:287: instantiated from `boost::xpressive::detail::sequence<BidiIter> boost::xpressive::regex_compiler<BidiIter, RegexTraits, CompilerTraits>::
parse_alternates(FwdIter&, FwdIter) [with FwdIter = const char*, BidiIter = std::basic_string<char, std::char_traits<char>, std::allocator<char> >::const_iterator, RegexTraits = boost::xpressive::rege
x_traits<char, boost::xpressive::cpp_regex_traits<char> >, CompilerTraits = boost::xpressive::compiler_traits<boost::xpressive::regex_traits<char, boost::xpressive::cpp_regex_traits<char> > >]'
D:/code/boost_1_46_1/boost/xpressive/regex_compiler.hpp:212: instantiated from `boost::xpressive::basic_regex<BidiIter> boost::xpressive::regex_compiler<BidiIter, RegexTraits, CompilerTraits>::compi
le_(FwdIter, FwdIter, boost::xpressive::regex_constants::syntax_option_type, std::forward_iterator_tag) [with FwdIter = const char*, BidiIter = std::basic_string<char, std::char_traits<char>, std::all
ocator<char> >::const_iterator, RegexTraits = boost::xpressive::regex_traits<char, boost::xpressive::cpp_regex_traits<char> >, CompilerTraits = boost::xpressive::compiler_traits<boost::xpressive::rege
x_traits<char, boost::xpressive::cpp_regex_traits<char> > >]'
D:/code/boost_1_46_1/boost/xpressive/regex_compiler.hpp:120: instantiated from `boost::xpressive::basic_regex<BidiIter> boost::xpressive::regex_compiler<BidiIter, RegexTraits, CompilerTraits>::compi
le(InputIter, InputIter, boost::xpressive::regex_constants::syntax_option_type) [with InputIter = const char*, BidiIter = std::basic_string<char, std::char_traits<char>, std::allocator<char> >::const_
iterator, RegexTraits = boost::xpressive::regex_traits<char, boost::xpressive::cpp_regex_traits<char> >, CompilerTraits = boost::xpressive::compiler_traits<boost::xpressive::regex_traits<char, boost::
xpressive::cpp_regex_traits<char> > >]'
D:/code/boost_1_46_1/boost/xpressive/regex_compiler.hpp:139: instantiated from `boost::xpressive::basic_regex<BidiIter> boost::xpressive::regex_compiler<BidiIter, RegexTraits, CompilerTraits>::compi
le(const typename boost::iterator_value<Iterator>::type*, boost::xpressive::regex_constants::syntax_option_type) [with BidiIter = std::basic_string<char, std::char_traits<char>, std::allocator<char> >
::const_iterator, RegexTraits = boost::xpressive::regex_traits<char, boost::xpressive::cpp_regex_traits<char> >, CompilerTraits = boost::xpressive::compiler_traits<boost::xpressive::regex_traits<char,
boost::xpressive::cpp_regex_traits<char> > >]'
D:/code/boost_1_46_1/boost/xpressive/basic_regex.hpp:200: instantiated from `static boost::xpressive::basic_regex<BidiIter> boost::xpressive::basic_regex<BidiIter>::compile(const typename boost::ite
rator_value<Iterator>::type*, boost::xpressive::regex_constants::syntax_option_type) [with BidiIter = std::basic_string<char, std::char_traits<char>, std::allocator<char> >::const_iterator]'
testBoost.cpp:13: instantiated from here
D:/code/boost_1_46_1/boost/xpressive/detail/utility/sequence_stack.hpp:24: error: `boost::xpressive::detail::fill' is not a function,
c:\windriver\gnu\3.4.4-vxworks-6.4\x86-win32\bin\../lib/gcc/powerpc-wrs-vxworks/3.4.4/../../../../include/c++/3.4.4/xutility:1661: error: conflict with `void std::fill(unsigned char*, unsigned char*
, int)'
c:\windriver\gnu\3.4.4-vxworks-6.4\x86-win32\bin\../lib/gcc/powerpc-wrs-vxworks/3.4.4/../../../../include/c++/3.4.4/vector:1039: error: in call to `fill'
c:\windriver\gnu\3.4.4-vxworks-6.4\x86-win32\bin\../lib/gcc/powerpc-wrs-vxworks/3.4.4/../../../../include/c++/3.4.4/vector:719: instantiated from `std::vector<_Ty, _Ax>::iterator std::vector<_Ty, _A
x>::insert(std::vector<_Ty, _Ax>::iterator, const _Ty&) [with _Ty = boost::xpressive::detail::shared_matchable<std::basic_string<char, std::char_traits<char>, std::allocator<char> >::const_iterator>,
_Ax = std::allocator<boost::xpressive::detail::shared_matchable<std::basic_string<char, std::char_traits<char>, std::allocator<char> >::const_iterator> >]'
c:\windriver\gnu\3.4.4-vxworks-6.4\x86-win32\bin\../lib/gcc/powerpc-wrs-vxworks/3.4.4/../../../../include/c++/3.4.4/vector:665: instantiated from `void std::vector<_Ty, _Ax>::push_back(const _Ty&) [
with _Ty = boost::xpressive::detail::shared_matchable<std::basic_string<char, std::char_traits<char>, std::allocator<char> >::const_iterator>, _Ax = std::allocator<boost::xpressive::detail::shared_mat
chable<std::basic_string<char, std::char_traits<char>, std::allocator<char> >::const_iterator> >]'
D:/code/boost_1_46_1/boost/xpressive/detail/dynamic/sequence.hpp:112: instantiated from `boost::xpressive::detail::sequence<BidiIter>& boost::xpressive::detail::sequence<BidiIter>::operator|=(boost:
:xpressive::detail::sequence<BidiIter>) [with BidiIter = std::basic_string<char, std::char_traits<char>, std::allocator<char> >::const_iterator]'
D:/code/boost_1_46_1/boost/xpressive/regex_compiler.hpp:287: instantiated from `boost::xpressive::detail::sequence<BidiIter> boost::xpressive::regex_compiler<BidiIter, RegexTraits, CompilerTraits>::
parse_alternates(FwdIter&, FwdIter) [with FwdIter = const char*, BidiIter = std::basic_string<char, std::char_traits<char>, std::allocator<char> >::const_iterator, RegexTraits = boost::xpressive::rege
x_traits<char, boost::xpressive::cpp_regex_traits<char> >, CompilerTraits = boost::xpressive::compiler_traits<boost::xpressive::regex_traits<char, boost::xpressive::cpp_regex_traits<char> > >]'
D:/code/boost_1_46_1/boost/xpressive/regex_compiler.hpp:212: instantiated from `boost::xpressive::basic_regex<BidiIter> boost::xpressive::regex_compiler<BidiIter, RegexTraits, CompilerTraits>::compi
le_(FwdIter, FwdIter, boost::xpressive::regex_constants::syntax_option_type, std::forward_iterator_tag) [with FwdIter = const char*, BidiIter = std::basic_string<char, std::char_traits<char>, std::all
ocator<char> >::const_iterator, RegexTraits = boost::xpressive::regex_traits<char, boost::xpressive::cpp_regex_traits<char> >, CompilerTraits = boost::xpressive::compiler_traits<boost::xpressive::rege
x_traits<char, boost::xpressive::cpp_regex_traits<char> > >]'
D:/code/boost_1_46_1/boost/xpressive/regex_compiler.hpp:120: instantiated from `boost::xpressive::basic_regex<BidiIter> boost::xpressive::regex_compiler<BidiIter, RegexTraits, CompilerTraits>::compi
le(InputIter, InputIter, boost::xpressive::regex_constants::syntax_option_type) [with InputIter = const char*, BidiIter = std::basic_string<char, std::char_traits<char>, std::allocator<char> >::const_
iterator, RegexTraits = boost::xpressive::regex_traits<char, boost::xpressive::cpp_regex_traits<char> >, CompilerTraits = boost::xpressive::compiler_traits<boost::xpressive::regex_traits<char, boost::
xpressive::cpp_regex_traits<char> > >]'
D:/code/boost_1_46_1/boost/xpressive/regex_compiler.hpp:139: instantiated from `boost::xpressive::basic_regex<BidiIter> boost::xpressive::regex_compiler<BidiIter, RegexTraits, CompilerTraits>::compi
le(const typename boost::iterator_value<Iterator>::type*, boost::xpressive::regex_constants::syntax_option_type) [with BidiIter = std::basic_string<char, std::char_traits<char>, std::allocator<char> >
::const_iterator, RegexTraits = boost::xpressive::regex_traits<char, boost::xpressive::cpp_regex_traits<char> >, CompilerTraits = boost::xpressive::compiler_traits<boost::xpressive::regex_traits<char,
boost::xpressive::cpp_regex_traits<char> > >]'
D:/code/boost_1_46_1/boost/xpressive/basic_regex.hpp:200: instantiated from `static boost::xpressive::basic_regex<BidiIter> boost::xpressive::basic_regex<BidiIter>::compile(const typename boost::ite
rator_value<Iterator>::type*, boost::xpressive::regex_constants::syntax_option_type) [with BidiIter = std::basic_string<char, std::char_traits<char>, std::allocator<char> >::const_iterator]'

源码直接下载地址: https://pan.quark.cn/s/854bd57df23a 在金融行业中,房产购置贷款是众多人在购置不动产时必须进行的一项财务规划。Matlab作为一种功能强大的数学及数据分析平台,经常被应用于各类复杂的运算,其中包括住房贷款的计算。本文将详细研究运用Matlab开发住房贷款计算程序的相关知识要点,以协助读者掌握如何借助编程技术处理实际的信贷问题。 1. **信贷种类** - **商业信贷**:此类贷款通常由金融机构提供,其利率会随市场行情变化,借款人可选用固定利率或浮动利率方案。 - **公积金信贷**:该类贷款获得政府机构的支持,利率一般低于商业信贷,但设有最高贷款金额的限制。 2. **偿付模式** - **等额本金偿付**:每月支付相同数量的本金,利息部分逐月减少,因此整体还款总额会逐步降低。 - **等额本息偿付**:每月支付固定金额的本金与利息组合,利息部分随本金的逐月减少而递减。 3. **住房贷款计算公式** - **等额本息偿付**:每月还款额=贷款本金×[月利率×(1+月利率)^(贷款期数)]÷[(1+月利率)^(贷款期数)-1]。 - **等额本金偿付**:每月应还本金=贷款总额/贷款期数,每月利息=(贷款余额-累计已还本金)×月利率。 4. **Matlab编程基础** - **变量设定**:在Matlab环境中,首要任务是设定贷款数额、年化利率、贷款时长等核心参数。 - **循环控制结构**:借助for循环来模拟每个还款周期的过程,进行本金与利息的计算。 - **函数构建**:将住房贷款的计算逻辑封装为函数,便于重复使用和测试不同条件下的结果。 5. **Matlab代码编写** - **等额本息函数实现**...

65,213

社区成员

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

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