Skip to content

Compilation with gcc 4.9.2 but running error on gcc 8.x #2277

@jixue

Description

@jixue

I used cpp-httplib version 0.18.3, compiled and packaged it with gcc 4.9.2. The generated package throws an error when running on gcc 8.x version. The error message is as follows:
#15 0x00007ffff7af449f in std::_Function_handler<bool (char const*, unsigned long, unsigned long, unsigned long), bool httplib::detail::prepare_content_receiver<httplib::Response, bool httplib::detail::read_contenthttplib::Response(httplib::Stream&, httplib::Response&, unsigned long, int&, std::function<bool (unsigned long, unsigned long)>, std::function<bool (char const*, unsigned long, unsigned long, unsigned long)>, bool)::{lambda(std::function<bool (char const*, unsigned long, unsigned long, unsigned long)> const&)#1}>(httplib::Response&, int&, std::function<bool (char const*, unsigned long, unsigned long, unsigned long)>, bool, bool httplib::detail::read_contenthttplib::Response(httplib::Stream&, httplib::Response&, unsigned long, int&, std::function<bool (unsigned long, unsigned long)>, std::function<bool (char const*, unsigned long, unsigned long, unsigned long)>, bool)::{lambda(std::function<bool (char const*, unsigned long, unsigned long, unsigned long)> const&)#1})::{lambda(char const*, unsigned long, unsigned long, unsigned long)#2}>::_M_invoke(std::_Any_data const&, char const*, unsigned long, unsigned long, unsigned long) (__functor=..., __args#0=0x7fffffff73c0 "@t\377\377\377\177",__args#1=140737488319416, __args#2=140737488319408, __args#3=140737488319400) at /docker/opt/rh/devtoolset-3/root/usr/include/c++/4.9.2/functional:2025#16 0x000000000047e626 in std::function<bool (char const*, unsigned long, unsigned long, unsigned long)>::operator()(char const*, unsigned long, unsigned long, unsigned long) const (this=0x7fffffffb4d0,__args#0=0x7fffffff7440 "{"status":"success","message":"null","result":.., __args#1=3048, __args#2=0, __args#3=3048) at /opt/rh/devtoolset-8/root/usr/include/c++/8/bits/std_function.h:687

It seems different STL libraries cause argument exceptions, i can't upgrade GCC version to 8.x and compiled. I replace std::regex with boost::regex and solve some errors,how can i solve this error?Can I modify code to resolve GCC compatibility issues?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions