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

README doesn't mention lua-c++ requirement #217

Open
ryandesign opened this issue May 29, 2023 · 2 comments
Open

README doesn't mention lua-c++ requirement #217

ryandesign opened this issue May 29, 2023 · 2 comments

Comments

@ryandesign
Copy link
Contributor

The README mentions that lua is required, but since gpick 0.3 it requires lua-c++ which is not in a standard lua install. The README should mention this unusual requirement, possibly with pointers on how to install lua-c++.

@MarcusCalhoun-Lopez
Copy link
Contributor

a8bc29c muddies the issue a bit.
If Lua is built with C++, surrounding the Lua headers with extern "C" { means the name mangled symbols are not found.

@thezbyg
Copy link
Owner

thezbyg commented May 31, 2023

@ryandesign I agree that README should mention that C++ Lua library variant is required and will soon improve it.

@MarcusCalhoun-Lopez C++ Lua library can have unmangled symbols but it requires patched src/luaconf.h file (see https://sources.debian.org/patches/lua5.4/5.4.4-3/0003-extern_C.patch/). If symbols are mangled then extern "C" { will have to be removed from src/Lua.h file. Different Linux distributions do different things, but if this patch is only applied on Debian/Ubuntu then I could add a new build option to specify which type of Lua library will be linked.

Non C++ Lua library could also be used, but it would leak memory on Lua errors, because Lua uses different error handling method depending on used compiler. C version uses longjump and C++ version uses exceptions. If some C++ function expects to release allocated memory on exit from function or scope, then this release will not happen if longjump is used, because a simple jump to Lua error handling code will be performed.

thezbyg added a commit that referenced this issue Jun 1, 2023
Add missing SCons.Util import.

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

No branches or pull requests

3 participants