epoupon / lms

Lightweight Music Server. Access your self-hosted music using a web interface.
http://lms-demo.poupon.dev
GNU General Public License v3.0
1.14k stars 62 forks source link

Unable to build with C++17 compiler #489

Closed simon816 closed 4 months ago

simon816 commented 4 months ago

Versions 3.50.0 onwards are not possible to build with a C++17 only compiler due to the use of a C++20 feature.

This commit: https://github.com/epoupon/lms/commit/6b1fd9c84121ecb04f11aef3897aa1166bd70575 used #include <span> which is only available since C++20 (https://en.cppreference.com/w/cpp/header/span)

I get the following error:

In file included from /data/packages/lms-3.50.0/src/libs/utils/include/utils/ILogger.hpp:25,
                 from /data/packages/lms-3.50.0/src/libs/utils/impl/Config.cpp:23:
/data/packages/lms-3.50.0/src/libs/utils/include/utils/String.hpp:24:10: fatal error: span: No such file or directory
   24 | #include <span>
      |          ^~~~~~
compilation terminated.

This is on Ubuntu 20.04, g++ 9.3.0

INSTALL.md says C++17 is the minimum required version: https://github.com/epoupon/lms/blob/master/INSTALL.md?plain=1#L36

Either the documentation should be updated or the code should be made backwards compatible

epoupon commented 4 months ago

Thanks for reporting. The documentation should be updated, C++20 is needed, and span is not the only C++20 feature used.