Here is a newbie ;-)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Here is a newbie ;-)

Christophe Gimenez
Hi ! I've just downloaded lua and started to make some test to understand 
how to use lua from a C program.

Every time I link I get an error "unresolved external symbol void __cdecl"

The 2 .lib files of lua are declared in my project (I use visual c 5) and 
the directories are ok...

I know ! This is a really newbie question... But after beeing using Lingo & 
ASP (money is money) for a while I forgot a lot of things !

Thanks in advance

in the meantime I hope to find by myself ;-)

Note : i've tried to compile the libs by myself and all works fine but I 
have the same problem when replacing the downloaded lib by the new ones .

chris

Reply | Threaded
Open this post in threaded view
|

RE: Here is a newbie ;-)

Christophe Gimenez
Okay I found by my self... My test was a .cpp file and thus treated by the c++ compiler.

But if I want to call lua functions from a C++ program ?

do I need :

extern "C"
{
	#lua includes
}

??

-----Message d'origine-----
De:	Christophe Gimenez [SMTP:[hidden email]]
Date:	mardi 14 mars 2000 15:02
A:	Multiple recipients of list
Objet:	Here is a newbie ;-)


Reply | Threaded
Open this post in threaded view
|

Re: Here is a newbie ;-)

Erik Hougaard
Christophe Gimenez wrote:
> 
> Okay I found by my self... My test was a .cpp file and thus treated by the c++ compiler.
> 
> But if I want to call lua functions from a C++ program ?
> 
> do I need :
> 
> extern "C"
> {
>         #lua includes
> }
> 

Yes, cause Lua is straight C - several people have made different C++
wrappers but they are not part of the official distribution!

/Erik

Reply | Threaded
Open this post in threaded view
|

RE: Here is a newbie ;-)

Luiz Henrique de Figueiredo
In reply to this post by Christophe Gimenez
>From: Christophe Gimenez <[hidden email]>

>But if I want to call lua functions from a C++ program ?

This is a FAQ: See http://www.tecgraf.puc-rio.br/lua/faq.html#5.1
--lhf