string_view not found when compiling c++17 code with clang in Ubuntu

8.9k Views Asked by At

I got the error message:

src/HttpRouter.h:28:10: fatal error: 'string_view' file not found

when trying to compile a library (uWebSockets) which happened to show the command it called to compile:

clang++ -flto -O3 -c -std=c++17 -Isrc -IuSockets/src examples/HelloWorld.cpp

I checked /usr/include and string_view was only found inside experimental

john@blam /usr/include $ find . | grep string_view
  ./c++/5/experimental/string_view.tcc
  ./c++/5/experimental/string_view

Even after I updated to libstdc++6-dev, it still can't find string_view library which came from the #include <string_view> line.

What gives?

0

There are 0 best solutions below