Tolua++

Anything related in any way to game development as a whole is welcome here. Tell us about your game, grace us with your project, show us your new YouTube video, etc.

Moderator: PC Supremacists

Post Reply
User avatar
WSPSNIPER
Chaos Rift Regular
Chaos Rift Regular
Posts: 145
Joined: Sun Jan 03, 2010 6:19 pm
Current Project: top down shooter
Favorite Gaming Platforms: ps3
Programming Language of Choice: c++

Tolua++

Post 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
User avatar
WSPSNIPER
Chaos Rift Regular
Chaos Rift Regular
Posts: 145
Joined: Sun Jan 03, 2010 6:19 pm
Current Project: top down shooter
Favorite Gaming Platforms: ps3
Programming Language of Choice: c++

Re: Tolua++

Post by WSPSNIPER »

I would like to try tolua++ not luabind my bad typo
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: Tolua++

Post 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.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
WSPSNIPER
Chaos Rift Regular
Chaos Rift Regular
Posts: 145
Joined: Sun Jan 03, 2010 6:19 pm
Current Project: top down shooter
Favorite Gaming Platforms: ps3
Programming Language of Choice: c++

Re: Tolua++

Post by WSPSNIPER »

Thanks I'll keep trying
User avatar
thejahooli
Chaos Rift Junior
Chaos Rift Junior
Posts: 265
Joined: Fri Feb 20, 2009 7:45 pm
Location: London, England

Re: Tolua++

Post 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.
I'll make your software hardware.
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: Tolua++

Post 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.
User avatar
thejahooli
Chaos Rift Junior
Chaos Rift Junior
Posts: 265
Joined: Fri Feb 20, 2009 7:45 pm
Location: London, England

Re: Tolua++

Post 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.
I'll make your software hardware.
Protimus
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 25
Joined: Mon Jun 01, 2009 9:27 pm
Current Project: Game Engine
Favorite Gaming Platforms: PC
Programming Language of Choice: C++
Location: Jackson, AL
Contact:

Re: Tolua++

Post 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.
:)
Judge not a man by his language but by his use of the language.
User avatar
thejahooli
Chaos Rift Junior
Chaos Rift Junior
Posts: 265
Joined: Fri Feb 20, 2009 7:45 pm
Location: London, England

Re: Tolua++

Post 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.
I'll make your software hardware.
Post Reply