我正在尝试从源代码FlyWithLua编译一个应用程序,其中包括 sol2 库。
\n我按照说明进行操作,但是当我运行时cmake --build ./build出现以下错误:
In file included from /home/jon/src/FlyWithLua/src/FloatingWindows\n\n/FLWIntegration.cpp:10:\n/home/jon/src/FlyWithLua/src/third_party/sol2/./upstream/sol.hpp: In lambda function:\n/home/jon/src/FlyWithLua/src/third_party/sol2/./upstream/sol.hpp:7194:59: \n error: \xe2\x80\x98numeric_limits\xe2\x80\x99 is not a member of \xe2\x80\x98std\xe2\x80\x99\n7194 | std::size_t space = (std::numeric_limits<std::size_t>::max)();\nRun Code Online (Sandbox Code Playgroud)\n此后同一行上还有其他几个错误,但我想如果我能解决这个错误,它们可能就会消失。
\n将以下包含添加到 .hpp 文件的解决方案存在几个类似的问题
\n#include <stdexcept>\n#include <limits>\nRun Code Online (Sandbox Code Playgroud)\n该sol.hpp文件包含以下导入:
#include <stddef.h>\n#include <limits.h>\nRun Code Online (Sandbox Code Playgroud)\nhttps://sol2.readthedocs.io/en/latest/errors.html给出了一些关于编译器可能无法识别这些内容的提示,包括:
\n\n编译器错误/警告
\n当出现问题时,可能会出现无数的编译器错误。以下是有关使用这些类型的一些基本建议:
\nRun Code Online (Sandbox Code Playgroud)If there are a myriad of errors relating to std::index_sequence, type traits, \nand other std:: members, it is likely …