-
Notifications
You must be signed in to change notification settings - Fork 633
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
luaopen_ functions should be extern "C" #422
Comments
PRs welcome, plus a bit more explanation or links to documentation for why. |
Compare e.g. https://github.com/lunarmodules/luafilesystem/blob/ff2cbc21f1a2fd34d30c0840ff2abb0121d46131/src/lfs.h#L34. This is required if you want to compile as C++ (not C), otherwise the symbols are not found in |
Thanks for the explanation and links. Yes I think this makes sense. Again PRs welcome. As a bonus some test tooling to show it working (or failing) for C and C++ builds would help too. |
Lua itself has no support for throwing with C++ exceptions, anyone doing that must be using custom patches against lua itself. Lua itself also does not support declaring Lua modules such as luasocket should similarly be included inside of an |
How would I do that in local socket = require("socket") ? |
huh? It's a question of how you compile (or include) luasocket; not how you load it into a running interpreter |
https://www.lua.org/manual/5.4/manual.html So when you |
Do you mean the library will have the wrong symbol name? or Lua will have the wrong symbol names? Lua's C module loader uses |
Well, I've encountered the issue when |
@phoppermann how did you compile luasocket? |
Also as C++ (like Lua itself to be aligned). Maybe that's not the right way? |
No description provided.
The text was updated successfully, but these errors were encountered: