[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Building LUA under linux fails
- From: Peter Cawley <lua@...>
- Date: Wed, 13 Jul 2011 18:57:07 +0100
On Wed, Jul 13, 2011 at 6:53 PM, Jason White
<whitewaterssoftwareinfo@gmail.com> wrote:
> Also I have a simple program http://pastebin.com/MyK5jiAX 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 http://pastebin.com/TdjHRbdK 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
linkage.