std :: regex - 是否有一些lib需要链接? [英] std::regex -- is there some lib that needs to be linked?

查看:267
本文介绍了std :: regex - 是否有一些lib需要链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到以下代码的链接器错误:

I get a linker error with the following code:

#include <regex>

int main()
{
    std::regex rgx("ello");
    return 0;
}

test.o: In function `basic_regex':
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/tr1_impl/regex:769: undefined reference to `std::basic_regex<char, std::regex_traits<char> >::_M_compile()'
collect2: ld returned 1 exit status


推荐答案

gcc-4.4.1 / include / c ++ / 4.4.1 / tr1_impl / regex

template <...>
class basic_regexp {
...
   private:
      /**
       * @brief Compiles a regular expression pattern into a NFA.
       * @todo Implement this function.
       */
      void _M_compile();

我想尚未准备好。

UPDATE:当前出血边缘GCC(SVN @ 153546)似乎还没有实现。

UPDATE: current bleeding edge GCC (SVN @153546) doesn't appear to have the implementation yet.

这篇关于std :: regex - 是否有一些lib需要链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆