DEV Community

sydney
sydney

Posted on

string_view library

I have this project that includes . When I go to compile the project I get "[Error] string_view: No such file or directory" from the compiler. Sounds like a compiler issue but I have no idea what to do to fix it! Anyone know how to fix this problem?
syd / wt1v

Top comments (2)

Collapse
 
syd_71 profile image
sydney

I tried that, it didn't work! It complained about not finding the header ! After looking around in the compiler options, I noticed that I could select various compiler versions. Some of my other example codes also did not compile and I got a complaint that compiler version C++11 (or some other one) was needed, so I went and selected the recommended compiler, and all was well. The GNU compilers are updated every 3 years! The string_view library didn't come out until after C++11 and DevC++ doesn't give a choice of the newer versions, which are needed to support string_view. So I guess the real question is how do I update DevC++ to add in these newer compilers into the list since it only goes to version 11 right now? Maybe an update to the DevC++ download?
syd / wt1v

Collapse
 
pauljlucas profile image
Paul J. Lucas

You aren't including the relevant header file. cppreference.com is your friend.