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;
}


...全文
206 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]'

内容概要:本文系统研究了锂离子电池模型在不同工况下的最佳性能与效率,聚焦于电池组配置、负载选择、放电倍率(C-rate)、容量及电量状态(SOC)等关键因素对电池系统行为的影响机制。通过Simulink平台构建精确的电池仿真模型,全面模拟多种运行条件,深入分析各参数对电池输出特性、能量效率、热特性及寿命衰减的作用规律。研究不仅涵盖模型搭建、参数辨识与动态响应仿真,还结合量化指标评估不同配置下的综合性能,提出优化策略以提升电池系统的能效表现与稳定性,为锂电池在复杂应用场景中的高效利用提供理论支撑与技术路径。; 适合人群:具备电化学、电气工程或自动化等相关专业背景,从事新能源技术、储能系统、动力电池管理等领域研究的科研人员与工程技术人员,特别适用于硕士、博士研究生及企业研发工程师。; 使用场景及目标:①指导电动汽车、储能电站等系统中锂离子电池的优化选型与配置设计;②支持电池管理系统(BMS)中SOC估算精度提升与充放电策略优化;③为多因素耦合下的电池性能仿真与能效评估提供可复用的Simulink建模框架,助力科研项目开发与工程验证。; 阅读建议:建议读者结合文中所述Simulink模型进行实操复现,重点观察不同C-rate与SOC区间对电池电压响应和能量损耗的影响,进一步可拓展至温度效应、老化模型及多电池一致性分析等方向进行深化研究。
内容概要:本文针对配电网在发生故障后的恢复重构问题,提出了一种结合改进深度优先搜索算法与二进制粒子群优化算法的混合求解方法。通过改进的深度优先搜索算法高效生成满足辐射状结构约束的可行网络拓扑,确保系统在故障隔离后能够快速构建合理的供电路径;同时,引入二进制粒子群优化算法对开关操作序列进行智能优化,在满足电压、潮流等运行约束的前提下,最小化停电损失、降低网络损耗,并最大化供电恢复能力。该方法在Matlab平台上完成了仿真验证,结果表明其在求解效率和优化性能方面均优于传统方法,适用于复杂配电网的快速自愈控制。; 适合人群:电气工程、电力系统自动化及相关专业的研究生、科研人员及从事配电网运行维护、智能电网开发的技术工程师。; 使用场景及目标:①实现配电网故障后的快速供电恢复与网络重构;②优化开关操作策略以减少停电范围和时间;③提升配电网的自愈能力与供电可靠性,支撑智能配电系统的自动化决策。; 阅读建议:此资源融合了图论搜索与群体智能优化技术,具有较强的理论深度与工程实用性,建议读者在熟悉配电网结构和潮流计算的基础上,结合提供的Matlab代码深入理解算法实现流程,并可通过更换不同规模的测试系统进一步验证算法的适应性与鲁棒性。

65,213

社区成员

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

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