[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua in c++ doesn't work?
- From: "Bram Vaessen" <bram.vaessen@...>
- Date: Thu, 5 Sep 2002 01:39:27 +0200
Thanks for your quick answers!! It works now... finally It's 01:39 am :S
----- Original Message -----
From: "Christian Vogler" <cvogler@gradient.cis.upenn.edu>
To: "Multiple recipients of list" <lua-l@tecgraf.puc-rio.br>
Sent: Thursday, September 05, 2002 1:30 AM
Subject: Re: Lua in c++ doesn't work?
> 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