SLADE icon indicating copy to clipboard operation
SLADE copied to clipboard

Help resolving a compile issue

Open andrewschott opened this issue 1 year ago • 1 comments

SLADE Version: (3.2.1) Operating System: (Linux)

Issue Details: I am working on making an RPM for both RHEL and Fedora. In mock I am getting on all platforms (so it should be an issue with my specfile) the same error which I cannot figure out:

[ 97%] Building CXX object src/CMakeFiles/slade.dir/Scripting/Export/Archive.cpp.o
In file included from /builddir/build/BUILD/SLADE-3.2.1/src/Scripting/Export/Archive.cpp:40:
/builddir/build/BUILD/SLADE-3.2.1/src/../thirdparty/sol/sol.hpp: In member function 'void sol::state_view::open_libraries(Args&& ...)':
/builddir/build/BUILD/SLADE-3.2.1/src/../thirdparty/sol/sol.hpp:24888:75: error: 'luaopen_bit32' was not declared in this scope; did you mean 'luaopen_utf8'?
24888 |                                                 luaL_requiref(L, "bit32", luaopen_bit32, 1);
      |                                                                           ^~~~~~~~~~~~~
      |                                                                           luaopen_utf8
make[2]: *** [src/CMakeFiles/slade.dir/build.make:4066: src/CMakeFiles/slade.dir/Scripting/Export/Archive.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:232: src/CMakeFiles/slade.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Any ideas? Thanks, Andrew.

andrewschott avatar Jul 13 '22 18:07 andrewschott

I've recently built SLADE from source in Fedora. The issue you're having is being caused by the fact that there is no bit32 library for lua 5.3 and up because they support bitwise operations natively. There might be a better way to to this without messing with the source code, but the solution I found was to comment out the lines in /thirdparty/sol/sol.hpp that tell lua to use the bit32 library, and then SLADE compiled successfully. See image below.

2022-07-22-100709

quotepilgrim avatar Jul 22 '22 13:07 quotepilgrim