Author Topic: Building Lua  (Read 12714 times)

Offline Decrius

  • Multiple posting newcomer
  • *
  • Posts: 81
    • Daevius
Building Lua
« 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
Check out my website: http://www.daevius.com

Offline orel

  • Multiple posting newcomer
  • *
  • Posts: 96
Re: Building Lua
« Reply #1 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

Inside you will find a lua compiler, and an lua interpreter. You will even have libraries to link with it.
windows XP SP2
mingw gcc 3.4.5
svn Code::Blocks and M$ Visual Studio 2005 and .NET to eat!! SVNInside plugin :http://forums.codeblocks.org/index.php/topic,7063.0.html

Offline bhagabhi

  • Single posting newcomer
  • *
  • Posts: 5
Re: Building Lua
« Reply #2 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.

Offline Decrius

  • Multiple posting newcomer
  • *
  • Posts: 81
    • Daevius
Re: Building Lua
« Reply #3 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 ;).
Check out my website: http://www.daevius.com

Offline Decrius

  • Multiple posting newcomer
  • *
  • Posts: 81
    • Daevius
Re: Building Lua
« Reply #4 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?
Check out my website: http://www.daevius.com