Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Build fail after 98% compiling: raylib-lua-sol/bin/../vendor/sol2/include/sol/stack_core.hpp:88:51: error: ‘numeric_limits’ is not a member of ‘std’ and at linking time: undefined reference to `lua_newuserdatauv'

未关闭
#46 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
42/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
cmake, cpp, lua
领域
build-system

调研方向

Start with vendor/sol2/include/sol/stack_core.hpp and the CMake configuration used to build raylib-lua-sol. Reproduce the reported compile and link failures, then inspect how the Lua library and sol2 dependency are selected and linked. Done means the project builds through the raylib-lua-sol executable without the numeric_limits or lua_newuserdatauv errors.

由索引模型根据 Issue 内容生成。

描述

Applied patch as in #45

There is still an issue with the sol2 vendor dependency (at bottom the patch)

[ 96%] Built target raylib
[ 98%] Building CXX object bin/CMakeFiles/raylib-lua-sol.dir/raylib-lua-sol.cpp.o
In file included from /home/pop/.cache/pacaur/raylib-lua-sol-git/src/raylib-lua-sol/bin/../vendor/sol2/include/sol/stack.hpp:28,
                 from /home/pop/.cache/pacaur/raylib-lua-sol-git/src/raylib-lua-sol/bin/../vendor/sol2/include/sol/sol.hpp:50,
                 from /home/pop/.cache/pacaur/raylib-lua-sol-git/src/raylib-lua-sol/bin/raylib-lua-sol.cpp:54:
/home/pop/.cache/pacaur/raylib-lua-sol-git/src/raylib-lua-sol/bin/../vendor/sol2/include/sol/stack_core.hpp: In function ‘void sol::detail::align_one(std::size_t, std::size_t, void*&)’:
/home/pop/.cache/pacaur/raylib-lua-sol-git/src/raylib-lua-sol/bin/../vendor/sol2/include/sol/stack_core.hpp:88:51: error: ‘numeric_limits’ is not a member of ‘std’
   88 |                         std::size_t space = (std::numeric_limits<std::size_t>::max)();
      |                                                   ^~~~~~~~~~~~~~
/home/pop/.cache/pacaur/raylib-lua-sol-git/src/raylib-lua-sol/bin/../vendor/sol2/include/sol/stack_core.hpp:88:77: error: expected primary-expression before ‘>’ token
   88 |                         std::size_t space = (std::numeric_limits<std::size_t>::max)();
      |                                                                             ^
/home/pop/.cache/pacaur/raylib-lua-sol-git/src/raylib-lua-sol/bin/../vendor/sol2/include/sol/stack_core.hpp:88:80: error: ‘::max’ has not been declared; did you mean ‘std::max’?
   88 |                         std::size_t space = (std::numeric_limits<std::size_t>::max)();
      |                                                                                ^~~
      |                                                                                std::max
In file included from /usr/include/c++/14.2.1/algorithm:61,
                 from /home/pop/.cache/pacaur/raylib-lua-sol-git/src/raylib-lua-sol/bin/../vendor/sol2/include/sol/stack_core.hpp:43:
/usr/include/c++/14.2.1/bits/stl_algo.h:5715:5: note: ‘std::max’ declared here
 5715 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/home/pop/.cache/pacaur/raylib-lua-sol-git/src/raylib-lua-sol/bin/../vendor/sol2/include/sol/stack_core.hpp: In function ‘void* sol::detail::align_usertype_pointer(void*)’:
/home/pop/.cache/pacaur/raylib-lua-sol-git/src/raylib-lua-sol/bin/../vendor/sol2/include/sol/stack_core.hpp:111:51: error: ‘numeric_limits’ is not a member of ‘std’
  111 |                         std::size_t space = (std::numeric_limits<std::size_t>::max)();
      |                                                   ^~~~~~~~~~~~~~
/home/pop/.cache/pacaur/raylib-lua-sol-git/src/raylib-lua-sol/bin/../vendor/sol2/include/sol/stack_core.hpp:111:77: error: expected primary-expression before ‘>’ token
  111 |                         std::size_t space = (std::numeric_limits<std::size_t>::max)();
      |                                                                             ^
/home/pop/.cache/pacaur/raylib-lua-sol-git/src/raylib-lua-sol/bin/../vendor/sol2/include/sol/stack_core.hpp:111:80: error: ‘::max’ has not been declared; did you mean ‘std::max’?
  111 |                         std::size_t space = (std::numeric_limits<std::size_t>::max)();
      |                                                                                ^~~
      |                                                                                std::max
/usr/include/c++/14.2.1/bits/stl_algo.h:5715:5: note: ‘std::max’ declared here
 5715 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/home/pop/.cache/pacaur/raylib-lua-sol-git/src/raylib-lua-sol/bin/../vendor/sol2/include/sol/stack_core.hpp: In function ‘void* sol::detail::align_usertype_unique_destructor(void*)’:
/home/pop/.cache/pacaur/raylib-lua-sol-git/src/raylib-lua-sol/bin/../vendor/sol2/include/sol/stack_core.hpp:133:51: error: ‘numeric_limits’ is not a member of ‘std’
  133 |                         std::size_t space = (std::numeric_limits<std::size_t>::max)();
      |                                                   ^~~~~~~~~~~~~~
/home/pop/.cache/pacaur/raylib-lua-sol-git/src/raylib-lua-sol/bin/../vendor/sol2/include/sol/stack_core.hpp:133:77: error: expected primary-expression before ‘>’ token
  133 |                         std::size_t space = (std::numeric_limits<std::size_t>::max)();
      |                                                                             ^
/home/pop/.cache/pacaur/raylib-lua-sol-git/src/raylib-lua-sol/bin/../vendor/sol2/include/sol/stack_core.hpp:133:80: error: ‘::max’ has not been declared; did you mean ‘std::max’?
  133 |                         std::size_t space = (std::numeric_limits<std::size_t>::max)();
      |                                                                                ^~~
      |                                                                                std::max
/usr/include/c++/14.2.1/bits/stl_algo.h:5715:5: note: ‘std::max’ declared here
 5715 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/home/pop/.cache/pacaur/raylib-lua-sol-git/src/raylib-lua-sol/bin/../vendor/sol2/include/sol/stack_core.hpp: In function ‘void* sol::detail::align_usertype_unique_tag(void*)’:
/home/pop/.cache/pacaur/raylib-lua-sol-git/src/raylib-lua-sol/bin/../vendor/sol2/include/sol/stack_core.hpp:155:51: error: ‘numeric_limits’ is not a member of ‘std’
  155 |                         std::size_t space = (std::numeric_limits<std::size_t>::max)();
      |                                                   ^~~~~~~~~~~~~~
/home/pop/.cache/pacaur/raylib-lua-sol-git/src/raylib-lua-sol/bin/../vendor/sol2/include/sol/stack_core.hpp:155:77: error: expected primary-expression before ‘>’ token
  155 |                         std::size_t space = (std::numeric_limits<std::size_t>::max)();
      |                                                                             ^
/home/pop/.cache/pacaur/raylib-lua-sol-git/src/raylib-lua-sol/bin/../vendor/sol2/include/sol/stack_core.hpp:155:80: error: ‘::max’ has not been declared; did you mean ‘std::max’?
  155 |                         std::size_t space = (std::numeric_limits<std::size_t>::max)();
      |                                                                                ^~~
      |                                                                                std::max
/usr/include/c++/14.2.1/bits/stl_algo.h:5715:5: note: ‘std::max’ declared here
 5715 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/home/pop/.cache/pacaur/raylib-lua-sol-git/src/raylib-lua-sol/bin/../vendor/sol2/include/sol/stack_core.hpp: In function ‘void* sol::detail::align_usertype_unique(void*)’:
/home/pop/.cache/pacaur/raylib-lua-sol-git/src/raylib-lua-sol/bin/../vendor/sol2/include/sol/stack_core.hpp:178:51: error: ‘numeric_limits’ is not a member of ‘std’
  178 |                         std::size_t space = (std::numeric_limits<std::size_t>::max)();
      |                                                   ^~~~~~~~~~~~~~
/home/pop/.cache/pacaur/raylib-lua-sol-git/src/raylib-lua-sol/bin/../vendor/sol2/include/sol/stack_core.hpp:178:77: error: expected primary-expression before ‘>’ token
  178 |                         std::size_t space = (std::numeric_limits<std::size_t>::max)();
      |                                                                             ^
/home/pop/.cache/pacaur/raylib-lua-sol-git/src/raylib-lua-sol/bin/../vendor/sol2/include/sol/stack_core.hpp:178:80: error: ‘::max’ has not been declared; did you mean ‘std::max’?
  178 |                         std::size_t space = (std::numeric_limits<std::size_t>::max)();
      |                                                                                ^~~
      |                                                                                std::max
/usr/include/c++/14.2.1/bits/stl_algo.h:5715:5: note: ‘std::max’ declared here
 5715 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/home/pop/.cache/pacaur/raylib-lua-sol-git/src/raylib-lua-sol/bin/../vendor/sol2/include/sol/stack_core.hpp: In function ‘void* sol::detail::align_user(void*)’:
/home/pop/.cache/pacaur/raylib-lua-sol-git/src/raylib-lua-sol/bin/../vendor/sol2/include/sol/stack_core.hpp:195:51: error: ‘numeric_limits’ is not a member of ‘std’
  195 |                         std::size_t space = (std::numeric_limits<std::size_t>::max)();
      |                                                   ^~~~~~~~~~~~~~
/home/pop/.cache/pacaur/raylib-lua-sol-git/src/raylib-lua-sol/bin/../vendor/sol2/include/sol/stack_core.hpp:195:77: error: expected primary-expression before ‘>’ token
  195 |                         std::size_t space = (std::numeric_limits<std::size_t>::max)();
      |                                                                             ^
/home/pop/.cache/pacaur/raylib-lua-sol-git/src/raylib-lua-sol/bin/../vendor/sol2/include/sol/stack_core.hpp:195:80: error: ‘::max’ has not been declared; did you mean ‘std::max’?
  195 |                         std::size_t space = (std::numeric_limits<std::size_t>::max)();
      |                                                                                ^~~
      |                                                                                std::max
/usr/include/c++/14.2.1/bits/stl_algo.h:5715:5: note: ‘std::max’ declared here
 5715 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
make[2]: *** [bin/CMakeFiles/raylib-lua-sol.dir/build.make:79: bin/CMakeFiles/raylib-lua-sol.dir/raylib-lua-sol.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1296: bin/CMakeFiles/raylib-lua-sol.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
==> ERROR: A failure occurred in build().

Need to apply this patch in vendor/sol2 directory:
patch -p1 -i <path_to>sol2_stdexcept.patch

diff --git a/include/sol/stack_core.hpp b/include/sol/stack_core.hpp
index aef8e47e..5b86db5b 100644
--- a/include/sol/stack_core.hpp
+++ b/include/sol/stack_core.hpp
@@ -43,6 +43,8 @@
 #include <algorithm>
 #include <sstream>
 #include <optional>
+#include <stdexcept>
+#include <limits>
 
 namespace sol {
        namespace detail {

Still fail at linking time (undefined reference to `lua_newuserdatauv'):

[100%] Linking CXX executable raylib-lua-sol
/usr/bin/ld: CMakeFiles/raylib-lua-sol.dir/raylib-lua-sol.cpp.o: in function `sol::function_detail::overloaded_function<0, raylib_lua_sol_structs(sol::state&)::{lambda()#1}, raylib_lua_sol_structs(sol::state&)::{lambda(Rectangle const&)#1}, raylib_lua_sol_structs(sol::state&)::{lambda(float, float, float, float)#1}>* sol::detail::user_allocate<sol::function_detail::overloaded_function<0, raylib_lua_sol_structs(sol::state&)::{lambda()#1}, raylib_lua_sol_structs(sol::state&)::{lambda(Rectangle const&)#1}, raylib_lua_sol_structs(sol::state&)::{lambda(float, float, float, float)#1}> >(lua_State*)':
raylib-lua-sol.cpp:(.text+0x439b8): undefined reference to `lua_newuserdatauv'
/usr/bin/ld: CMakeFiles/raylib-lua-sol.dir/raylib-lua-sol.cpp.o: in function `sol::function_detail::overloaded_function<0, raylib_lua_sol_structs(sol::state&)::{lambda()#2}, raylib_lua_sol_structs(sol::state&)::{lambda(unsigned char, unsigned char, unsigned char)#1}, raylib_lua_sol_structs(sol::state&)::{lambda(unsigned char, unsigned char, unsigned char, unsigned char)#1}>* sol::detail::user_allocate<sol::function_detail::overloaded_function<0, raylib_lua_sol_structs(sol::state&)::{lambda()#2}, raylib_lua_sol_structs(sol::state&)::{lambda(unsigned char, unsigned char, unsigned char)#1}, raylib_lua_sol_structs(sol::state&)::{lambda(unsigned char, unsigned char, unsigned char, unsigned char)#1}> >(lua_State*)':
raylib-lua-sol.cpp:(.text+0x44384): undefined reference to `lua_newuserdatauv'
/usr/bin/ld: CMakeFiles/raylib-lua-sol.dir/raylib-lua-sol.cpp.o: in function `sol::function_detail::overloaded_function<0, raylib_lua_sol_structs(sol::state&)::{lambda()#3}, raylib_lua_sol_structs(sol::state&)::{lambda(float, float)#1}>* sol::detail::user_allocate<sol::function_detail::overloaded_function<0, raylib_lua_sol_structs(sol::state&)::{lambda()#3}, raylib_lua_sol_structs(sol::state&)::{lambda(float, float)#1}> >(lua_State*)':
raylib-lua-sol.cpp:(.text+0x44700): undefined reference to `lua_newuserdatauv'
/usr/bin/ld: CMakeFiles/raylib-lua-sol.dir/raylib-lua-sol.cpp.o: in function `sol::function_detail::overloaded_function<0, raylib_lua_sol_structs(sol::state&)::{lambda()#4}, raylib_lua_sol_structs(sol::state&)::{lambda(float)#1}, raylib_lua_sol_structs(sol::state&)::{lambda(float, float)#2}, raylib_lua_sol_structs(sol::state&)::{lambda(float, float, float)#1}>* sol::detail::user_allocate<sol::function_detail::overloaded_function<0, raylib_lua_sol_structs(sol::state&)::{lambda()#4}, raylib_lua_sol_structs(sol::state&)::{lambda(float)#1}, raylib_lua_sol_structs(sol::state&)::{lambda(float, float)#2}, raylib_lua_sol_structs(sol::state&)::{lambda(float, float, float)#1}> >(lua_State*)':
raylib-lua-sol.cpp:(.text+0x45794): undefined reference to `lua_newuserdatauv'
/usr/bin/ld: CMakeFiles/raylib-lua-sol.dir/raylib-lua-sol.cpp.o: in function `sol::function_detail::overloaded_function<0, raylib_lua_sol_structs(sol::state&)::{lambda()#5}, raylib_lua_sol_structs(sol::state&)::{lambda(float)#2}, raylib_lua_sol_structs(sol::state&)::{lambda(float, float)#3}, raylib_lua_sol_structs(sol::state&)::{lambda(float, float, float)#2}, raylib_lua_sol_structs(sol::state&)::{lambda(float, float, float, float)#2}>* sol::detail::user_allocate<sol::function_detail::overloaded_function<0, raylib_lua_sol_structs(sol::state&)::{lambda()#5}, raylib_lua_sol_structs(sol::state&)::{lambda(float)#2}, raylib_lua_sol_structs(sol::state&)::{lambda(float, float)#3}, raylib_lua_sol_structs(sol::state&)::{lambda(float, float, float)#2}, raylib_lua_sol_structs(sol::state&)::{lambda(float, float, float, float)#2}> >(lua_State*)':
raylib-lua-sol.cpp:(.text+0x4685c): undefined reference to `lua_newuserdatauv'
/usr/bin/ld: CMakeFiles/raylib-lua-sol.dir/raylib-lua-sol.cpp.o:raylib-lua-sol.cpp:(.text+0x46fd4): more undefined references to `lua_newuserdatauv' follow
collect2: error: ld returned 1 exit status
make[2]: *** [bin/CMakeFiles/raylib-lua-sol.dir/build.make:109: bin/raylib-lua-sol] Error 1
make[1]: *** [CMakeFiles/Makefile2:1296: bin/CMakeFiles/raylib-lua-sol.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
主要语言
C++
星标
120
派生
22
平均合并
50 分钟
30 天内合并 PR
1

环境准备

我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

RobLoach/raylib-lua-sol 的其他 Issue

查看 RobLoach/raylib-lua-sol 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。