lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

General question to inform some possible personal endeavors over the summer: I know that stock Lua will compile cleanly as C++ as well as C. Can a Lua executable compiled as one (C or C++) successfully load and use an extension module (*.dll or *.so) written in the other? If so, are any special steps needed, and what caveats are there (and are there any open-source examples I can look at)? If not, is the problem something that might be easily overcome with some tinkering, or is the problem more intractable? I suspect they can load each other without issues, but I'm not certain.

I'm most interested in a C-compiled Lua and C++ extension module, but the other direction (C++ Lua and C module) is of interest also. I have only worked in the past with C for both, partially due to my lack of C++ exposure until this semester of college, so I have never attempted C++ Lua compilation or module code.