RobLoach / RobLoach/raylib-lua-sol

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'

Open
#46 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
120
Forks
22
Avg merge
50m
Merged PRs (30d)
1

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

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.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, lua
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.