Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: jakovo on July 15, 2010, 10:59:33 pm

Title: Compiling LUA Code with Code::Blocks
Post by: jakovo on July 15, 2010, 10:59:33 pm
Hi,

in the current project I'm on, I need to compile some code in LUA (using obviously the lua compiler).

1) is there any way to tell Code::Blocks that I want to use a different compiler from the list it has by default?...

2) and is there anyhow to build the whole project so that my C++ code gets built with the default C++ compiler, and my LUA files get compiled with its "luac" compiler?
(I've seen that by selecting a specific file you can choose special build options for it, but I can't ask it to use "luac")

Thanks!
Title: Re: Compiling LUA Code with Code::Blocks
Post by: oBFusCATed on July 15, 2010, 11:10:47 pm
Haha, compiling lua code... haha...

Lua is interpreted language, so there is no compiler (technically there is a luaJIT and other similar compilers).

Probably what you need is to embed the lua interpreter in c++ program,
if so, probably you have to look into luabind (very good library, but a bit heavy on the compiler) and similar libraries.
If you want to achieve something else, please explain better.
Title: Re: Compiling LUA Code with Code::Blocks
Post by: mandrav on July 16, 2010, 10:56:45 am
in the current project I'm on, I need to compile some code in LUA (using obviously the lua compiler).

1) is there any way to tell Code::Blocks that I want to use a different compiler from the list it has by default?...

2) and is there anyhow to build the whole project so that my C++ code gets built with the default C++ compiler, and my LUA files get compiled with its "luac" compiler?
(I've seen that by selecting a specific file you can choose special build options for it, but I can't ask it to use "luac")

Adding support for non C/C++ files to the build system (http://wiki.codeblocks.org/index.php?title=Adding_support_for_non_C/C%2B%2B_files_to_the_build_system)
Title: Re: Compiling LUA Code with Code::Blocks
Post by: jakovo on July 16, 2010, 09:09:58 pm
@oBFusCATed: yes, though LUA is an interpreted language it has a compiler (not to native code, but to a binary intermediate code wich can be run by the interpreter).

@mandrav: Hey!.. Great!.. Thanks!.. I think that'll do!... just what I was looking for!

Thank you both, guys!

jakovo