lfreist / hwinfo

cross platform C++ library for hardware information (CPU, RAM, GPU, ...)
MIT License
438 stars 76 forks source link

#include <optional> cpu.h:7:20: fatal error: optional: No such file or directory #43

Closed double2li closed 1 year ago

double2li commented 1 year ago

in arm64 debian9 , gcc 6.3.0,compile error

include cpu.h:7:20: fatal error: optional: No such file or directory

lfreist commented 1 year ago

Hi!

Thank you for your report. std::optional is a c++17 feature. However, afaik gcc v.6.3 does not support it yet.

I am currently working on moving the library back to C++11 and didn't notice the problem of using optional yet. I will provide a fix in the next days.

Until then, it might be that using #include <experimental/optional> works with gcc v.6.3, but I am not sure about it...

lfreist commented 1 year ago

I have just realised that the use of std::optional already was removed but the include statement was not. I removed it and it should work by now.