掌機 - Miyoo A30 - 解決Undefined reference to std::filesystem問題



參考資訊:
https://blog.csdn.net/yuanlulu/article/details/126115051

問題如下:

liblove_3p_glslang.a(ParseContextBase.cpp.o): In function `glslang::TInfoSinkBase::location(glslang::TSourceLoc const&, bool)':
ParseContextBase.cpp:(.text._ZN7glslang13TInfoSinkBase8locationERKNS_10TSourceLocEb[_ZN7glslang13TInfoSinkBase8locationERKNS_10TSourceLocEb]+0x110): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
ParseContextBase.cpp:(.text._ZN7glslang13TInfoSinkBase8locationERKNS_10TSourceLocEb[_ZN7glslang13TInfoSinkBase8locationERKNS_10TSourceLocEb]+0x120): undefined reference to `std::filesystem::absolute(std::filesystem::__cxx11::path const&)'
ParseContextBase.cpp:(.text._ZN7glslang13TInfoSinkBase8locationERKNS_10TSourceLocEb[_ZN7glslang13TInfoSinkBase8locationERKNS_10TSourceLocEb]+0x21c): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
ParseContextBase.cpp:(.text._ZN7glslang13TInfoSinkBase8locationERKNS_10TSourceLocEb[_ZN7glslang13TInfoSinkBase8locationERKNS_10TSourceLocEb]+0x22c): undefined reference to `std::filesystem::absolute(std::filesystem::__cxx11::path const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/love.dir/build.make:163: love] Error 1
make[1]: *** [CMakeFiles/Makefile2:1760: CMakeFiles/love.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

解法如下:

LDFLAGS += -lstdc++fs