Page 1 of 1

Tolua++

Posted: Sun Jan 03, 2010 7:58 pm
by WSPSNIPER
I am intrested in how you set up tolua++ for future use right now I'm using luabind but I would like to try luabind

I'm using windows with visual studio 2008

not super important but would be nice to know and I don't understand the tutorial on stewing it up so whatever you can tell me would be cool

Re: Tolua++

Posted: Sun Jan 03, 2010 7:59 pm
by WSPSNIPER
I would like to try tolua++ not luabind my bad typo

Re: Tolua++

Posted: Sun Jan 03, 2010 8:04 pm
by dandymcgee
It's similar to setting up anything else. You need the include files, and the libraries. Also you'll want a compiled version of the tolua++ tool that parses "cleaned" header files and outputs files for you to include in your project. It's really easy to use but a pain in the ass to get working correctly.

As tolua++ is only available in source form, and requires SCons to be built, compiling it was by far the hardest part of getting it set up for me.

Re: Tolua++

Posted: Sun Jan 03, 2010 9:06 pm
by WSPSNIPER
Thanks I'll keep trying

Re: Tolua++

Posted: Sat Mar 06, 2010 6:56 am
by thejahooli
Sorry for reviving an old topic but I didn't see the need to create a new one for the same question. I can't figure out how to get toLua++ working. I've downloaded it but I do not understand how to install it for the executable and library. The only documentation on it (the INSTALL file) didn't help much.

Re: Tolua++

Posted: Mon Mar 08, 2010 11:40 am
by Falco Girgis
Can you be more specific about what you can't get to work?

ToLua++ is broken into two components: a standalone executable and a library. Both compile (for me) with Visual Studio 2008 straight out of the box. Create a new console application, throw all of the headers/source from the application into there and build.

Then create a new application as either a .DLL or statically linked library (.lib) and throw the two/three source files and headers into there. If you can't be bothered with actually creating a tolua.dll or tolua.lib, you can even just throw the three .cpp files and .h files into whatever project you're working on instead.

ToLua++ uses completely standard C++, so compiling should be easy as shit.

Re: Tolua++

Posted: Mon Mar 08, 2010 4:30 pm
by thejahooli
I've tried to compile but I get linker errors:

Code: Select all

1>toluabind_default.obj : error LNK2005: _tolua_tolua_open already defined in toluabind.obj
1>toluabind_default.obj : error LNK2005: _luaopen_tolua already defined in toluabind.obj
1>C:\Users\Thomas\Documents\Visual Studio 2008\Projects\toLua++\Debug\Executable.exe : fatal error LNK1169: one or more multiply defined symbols found
All I've done is take the header and c files, copy them into a project, link the project with lua5.1.lib and then compile. Is there any edits needed to be made to the code or to the project settings because I've never been good with linker errors.

Re: Tolua++

Posted: Tue Mar 09, 2010 3:46 pm
by Protimus
tolua++-1.0.93/INSTALL wrote:* Installation without scons

The instructions for building tolua++ without scons depend on the particular
compiler you are using.
The simplest way is to create a folder with all .c and .h files except
'toluabind_default.c'
, and then create a project for the executable and the
library, as follows:

tolua.exe: all *.c *.h in src/bin (except toluabind_default.c)
tolua.lib: all *.c *.h in src/lib.
:)

Re: Tolua++

Posted: Thu Mar 11, 2010 4:40 pm
by thejahooli
One more thing that I need help with, yet I can't find anything in the reference about it. How do I send an object of a class to Lua to use.

Code: Select all

Enemy enemy;
How do I send that specific enemy instance to Lua so that I can call it's functions.