how to include lua

  • Follow


Hi
how to include lua (eclipse,linux)?
Thanks Michael

with
> #include <lua.h>
> #include <lauxlib.h>

i get:
> ../plugin_source/luagl.c:27:17: warning: lua.h: No such file or directory
> ../plugin_source/luagl.c:28:21: warning: lauxlib.h: No such file or directory


0
Reply Michael106 (11) 7/11/2011 7:00:10 AM

On Jul 11, 9:00=A0am, Michael <Mich...@notspam.com> wrote:
> how to include lua (eclipse,linux)?
> Thanks Michael
>
> with
>
> > #include <lua.h>
> > #include <lauxlib.h>
>
> i get:
>
> > ../plugin_source/luagl.c:27:17: warning: lua.h: No such file or directo=
ry
> > ../plugin_source/luagl.c:28:21: warning: lauxlib.h: No such file or dir=
ectory

Add lua to your include path:
http://help.eclipse.org/galileo/topic/org.eclipse.cdt.doc.user/tasks/cdt_t_=
proj_paths.htm

Ask on eclipse/CDT or eclipse forums for further questions, you are OT
here.

--
Michael
0
Reply michael.doubez (922) 7/11/2011 8:21:09 AM


yes I've included lua headers but am unsure about the linker settings. 
tried lua and LUA without changes and that errors are weird. will ask
also in eclipse forum

0
Reply Michael106 (11) 7/11/2011 12:02:14 PM

Following this:
http://csl.sublevel3.org/lua/


extern "C" {
#include <lua.h>
#include <lauxlib.h>
}

I get this error:

agl.c:14: error: expected identifier or �(� before string constant
l.c:15:17: warning: lua.h: No such file or directory
uagl.c:16:21: warning: lauxlib.h: No such file or directory

Why? Thanks

0
Reply Michael106 (11) 7/12/2011 8:28:18 AM

Michael <Michael@notspam.com> writes:
> extern "C" {
> #include <lua.h>
> #include <lauxlib.h>
> }
>
> I get this error:
>
> agl.c:14: error: expected identifier or ‘(’ before string constant

Are you actually using a C++ compiler?

> l.c:15:17: warning: lua.h: No such file or directory
> uagl.c:16:21: warning: lauxlib.h: No such file or directory

It looks like those include files are not on your include path...

Where did you install them?

-Miles

-- 
80% of success is just showing up.  --Woody Allen
0
Reply miles7 (230) 7/12/2011 8:50:31 AM

Hi -Miles
g++

michael@ubuntu:~$ cd /usr
michael@ubuntu:/usr$ find . -name "*lua*"
../local/lib/luarocks
../src/linux-headers-2.6.32-23-generic-pae/include/config/sound/kahlua.h
../src/linux-headers-2.6.32-23-generic-pae/include/config/scsi/dh/alua.h
../include/FL/Fl_Valuator.H
../include/luajit-2.0
../include/luajit-2.0/luajit.h
../include/luajit-2.0/lualib.h
../include/luajit-2.0/lua.h
../include/luajit-2.0/luaconf.h
../include/luajit-2.0/lua.hpp
../include/lua5.1
../include/lua5.1/lua-curl.h
../include/lua5.1/luasocket.h
../include/lua5.1/lualib.h
../include/lua5.1/lua.h
../include/lua5.1/luaconf.h
../include/lua5.1/lua.hpp


at least lua.h should be found as I do:

-I/usr/include/lua5.1
Thanks
Michael
0
Reply Michael106 (11) 7/12/2011 6:48:38 PM

5 Replies
34 Views

(page loaded in 0.075 seconds)


Reply: