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


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

1.41.0版本的中文文档20091225,已完成翻译91个库. 汉化 boost 文档,致力 boost 推广。 如果你对本项目有兴趣,欢迎加入,相关说明请查阅项目论坛: https://groups.google.com/ 到目前为止,各人贡献的译文如下: 贡献者 贡献的译文 alai04 accumulators, any, assign, bimap, call_traits, circular_buffer, compatibility, concept check, config, conversion, date_time, filesystem, foreach, function_types, functional, integer, intrusive, io state savers, iostreams, iterators, minmax, mpl, multi_array, multi_index, numeric/conversion, operators, optional, pointer container, pool, preprocessor, program_options, property map, property_tree, proto, range, rational, scope_exit, serialization, spirit, statechart, swap, system, tokenizer, TR1, tribool, unordered, utility, value_initialized, variant, wave, xpressive fatalerror99 array, bind & mem_fn, dynamic_bitset, function, functional/hash, in_place_factory & typed_in_place_factory, lambda, ref, smart_ptr, static_assert, string_algo, type_traits, typeof farproc compressed_pair, crc, enable_if blackjazz07 conversion/lexical_cast, format hzjboost tuple xuwaters parameter, timer 金庆 python, signals, signals2 zhaohongchao exception, gil luckycat06 interval, math, math/complex number algorithms, math/common_factor, math/octonion, math/quaternion, math/special_functions, math/statistical, uBLAS lixin regex, test, units evy.wang thread xiaq random 水的影子 flyweight

64,637

社区成员

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

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