Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling fails on Fedora 35 with scripting enabled #114

Open
aweirddudee opened this issue Dec 28, 2021 · 1 comment
Open

Compiling fails on Fedora 35 with scripting enabled #114

aweirddudee opened this issue Dec 28, 2021 · 1 comment

Comments

@aweirddudee
Copy link

aweirddudee commented Dec 28, 2021

Attempting to compile with scripting results in a large amount of sol2 errors when following the guide in the README at the point of make -j $(nproc) at [100%] Linking CXX executable bin/noggit.

/usr/bin/ld: CMakeFiles/noggit.dir/src/noggit/scripting/script_context.cpp.o: in function `void sol::state_view::open_libraries<sol::lib, sol::lib, sol::lib>(sol::lib&&, sol::lib&&, sol::lib&&)':
script_context.cpp:(.text._ZN3sol10state_view14open_librariesIJNS_3libES2_S2_EEEvDpOT_[_ZN3sol10state_view14open_librariesIJNS_3libES2_S2_EEEvDpOT_]+0x1ea): undefined reference to `luaopen_bit'
/usr/bin/ld: script_context.cpp:(.text._ZN3sol10state_view14open_librariesIJNS_3libES2_S2_EEEvDpOT_[_ZN3sol10state_view14open_librariesIJNS_3libES2_S2_EEEvDpOT_]+0x2d3): undefined reference to `luaopen_ffi'
/usr/bin/ld: script_context.cpp:(.text._ZN3sol10state_view14open_librariesIJNS_3libES2_S2_EEEvDpOT_[_ZN3sol10state_view14open_librariesIJNS_3libES2_S2_EEEvDpOT_]+0x30b): undefined reference to `luaopen_jit'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/noggit.dir/build.make:1958: bin/noggit] Error 1
make[1]: *** [CMakeFiles/Makefile2:845: CMakeFiles/noggit.dir/all] Error 2
make: *** [Makefile:166: all] Error 2

After replacing the sol2 headers with v3.2.2's headers (https://github.com/ThePhD/sol2/releases) at build/_deps/sol2-src/include/sol, the terminal dumps the following errors at [ 81%] Building CXX object CMakeFiles/noggit.dir/src/noggit/scripting/script_exception.cpp.o
terminaldump.txt

@bloerwald
Copy link
Contributor

The linker error indicates that Lua isn't correctly linked. The given symbol names seem to be unconditionally compiled in luajit, so there might have been an issue when installing luajit or when giving it to CMake when building Noggit. Please double-check the paths used. If you're 100% sure it is correct, verify that the path given to -DLUA_LIBRARIES= contains the symbols using nm that/path.so | grep -E 'luaopen_(bit|ffi|jit)'. It should give three lines that are not prefixed with an U.

The compiler error is probably not worth debugging: You have partially replaced files from the sol repository, which probably does not go well by definition: you didn't replace the entire source as well. The issue at hand was fixed in sol 3.2.3 though: ThePhD/sol2@e5e6466#diff-c96c96c60cfc1ade13e4c968883c2f6bb4b37befebb8e858d158b939b8e989da. The version Noggit uses by default includes that fix: https://github.com/ThePhD/sol2/blob/b9c83d5ec/include/sol/stack_core.hpp#L43, so by not modifying the sources you should already have a working version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants