lua-users home
lua-l archive

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



On Mar 24, 2005, at 18:33, Glenn Maynard wrote:

On Thu, Mar 24, 2005 at 06:53:58AM -0300, Luiz Henrique de Figueiredo wrote:
Try adding
extern "C" { }

In 5.1 you can include lua.hpp, which will do this for you. It's in etc/.

If it's not in /usr/include by default, it's not useful--if it's not in
the includes that everyone has installed, I need to do it myself.  Why
not just do this in .h files, like just about every other library?  (I
can't think of any benefit to having a special header for this.)

Have you the question "Why isn't there an extern "C" block, required for C++, in the API header?" in the Lua FAQ at http://lua-users.org/wiki/LuaFaq ?

The answer is basically two-fold:

i) As a C library, Lua makes no special arrangements for access by foreign languages, including C++.

ii) The Lua source is compilable as C++ and therefore using extern "C" would be inappropriate.


What has /usr/include got to do with this?

David Jones