lua-users home
lua-l archive

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


On Thu, Sep 05, 2002 at 01:22:30AM +0200, Bram Vaessen wrote:
> Isn't there a way to use lua in c++ ? My whole prog is written in C++ so I
> would like to use that...

Your linker thinks that the functions from the lua library are written
in C++, and hence it looks for them in a form that includes all type
information, but this information does not exist. You have to ensure
that the compiler and the linker know that the lua library functions
are compiled with a C compiler.

To achieve this, you need to bracket your #include directives for the
lua-related header files with 'extern "C"', like this:

extern "C" {
#inclue <lua.h>
#include <lualib.h>
}

Regards
- Christian