Code::Blocks

User forums => Using Code::Blocks => Topic started by: Decrius on February 07, 2008, 08:08:18 pm

Title: Building Lua
Post by: Decrius on February 07, 2008, 08:08:18 pm
Hi,

I have zero knowledge about makefiles and stuff. There doesn't seem to be nice tutorials for this, ppl keep saying "oh, simply do this" or "_simply_ do that".

Can anybody explain me how I can build Lua in Code::Blocks? The source is just a bunch of .cpp and .h files, and I see nowhere a project file (if it would be a visual basic file I could at least TRY to build it, which often gives loads of errors -.-).

I have even tried GS6 (or whatever its called), which has VS project files, but just gives me lots of errors :(. I just need a scripting language...

Thanks for any help :)
Decrius
Title: Re: Building Lua
Post by: orel on February 07, 2008, 08:53:46 pm
I just need a scripting language...

Hi Decrius,

while building lua is for sure an easy task, and though i think you can find tutorials for that task, if you JUST need a scripting language, why not download it, it can saves you building it with a language/environment you don't know (C/C++) and you don't need !!

You can find official Lua binaries for the most-used platforms here : http://luabinaries.luaforge.net/download.html (http://luabinaries.luaforge.net/download.html)

Inside you will find a lua compiler, and an lua interpreter. You will even have libraries to link with it.
Title: Re: Building Lua
Post by: bhagabhi on February 07, 2008, 09:26:49 pm
Well, it really is easy  :)

This thread made me want to try - so here we go:

I'm running CodeBlocks on windows using the MinGW compiler, and I just made a static library project (created it in a subfolder to my LUA directory) - removed the main.c file that CodeBlocks created as default, added all sourcefiles of LUA (both .h and .c), and pressed compile.

This creates the library (an .a file) - installing it so it is availible to all MinGW programs is as easy as copying the .a file to my mingw/lib folder, and lua.h, lualib.h and lauxlib.h to the mingw/include folder.

This won't build the luac (the Lua compiler) though.
Title: Re: Building Lua
Post by: Decrius on February 07, 2008, 10:54:33 pm
Well, I do know C/C++, I program mainly in it. But I have no knowledge about how to use a compiler without the IDE ^^. So makefiles are really new to me. As for Lua: I will use it for the games I make.

@bhagabhi: is it really that easy? I will try it tomorrow, but I usually get tons of errors and stuff :(

@orel: I can download the binaries, but I want lua to be build inside my applications, so I wont have to add the lua binaries when I give it to other people ;).
Title: Re: Building Lua
Post by: Decrius on February 08, 2008, 03:29:27 pm
It says: "You must select a host application to "run" a library..." =/

Is there a tutorial available for for this sort of things in CB?