You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In C++ project, now, user must apply it himself.
But noticing that this is needed is not straight away.
User will just find link error and the gcc error message is not that rich enough to provide such information..
The text was updated successfully, but these errors were encountered:
Because you can compile Lua both as C and as C++ code, lua.h does not include this typical adjustment code that is present in several other C libraries:
Therefore, if you have compiled Lua as C code (the most common case) and are using it in C++, you must include lua.h as follows:
extern "C" {
#include <lua.h>
}
A common trick is to create a header file lua.hpp with the above code and to include this new file in your C++ programs.
But from 5.1 lua includes lua.hpp as shown below:
// lua.hpp
// Lua header files for C++
// <<extern "C">> not supplied automatically because Lua also compiles as C++
In C++ project, now, user must apply it himself.
But noticing that this is needed is not straight away.
User will just find link error and the gcc error message is not that rich enough to provide such information..
The text was updated successfully, but these errors were encountered: