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.