std::regex — is there some lib that needs to be linked?

前端 未结 2 728
攒了一身酷
攒了一身酷 2021-02-20 12:09

I get a linker error with the following code:

#include 

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

test.o: In function `basic_rege         


        
2条回答
  •  独厮守ぢ
    2021-02-20 12:34

    From 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();
    

    I guess it's not ready yet.

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

提交回复
热议问题