Author Topic: Compiling LUA Code with Code::Blocks  (Read 4839 times)

Offline jakovo

  • Single posting newcomer
  • *
  • Posts: 2
Compiling LUA Code with Code::Blocks
« 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!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12898
    • Travis build status
Re: Compiling LUA Code with Code::Blocks
« Reply #1 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4305
    • Code::Blocks IDE
Re: Compiling LUA Code with Code::Blocks
« Reply #2 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
Be patient!
This bug will be fixed soon...

Offline jakovo

  • Single posting newcomer
  • *
  • Posts: 2
Re: Compiling LUA Code with Code::Blocks
« Reply #3 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