lua-users home
lua-l archive

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

Thanks !

On Wed, Jul 13, 2011 at 1:57 PM, Peter Cawley <> wrote:
On Wed, Jul 13, 2011 at 6:53 PM, Jason White
<> wrote:
> Also I have a simple program taken from a
> tutorial on the web (I realise it has no error checking ...) it doesn't
> compile, I have the LUA 5.1 source (all *c & *.h) plus the program above and
> it produces the following when compiled, as far
> as I can tell this should not be happening (it not finding every LUA
> function called) since the LUA library is being compiled and liked with it.
> Thanks again ...

Because Lua's C API is implemented in .c files, whose names then get
exported with C linkage. Your .cpp file doesn't have [[extern "C" {
... }]] around the #include statements, and thus doesn't import with C

Jason White - Python & C++ Programmer and Electronics Hobbyist