我正在做什么来为Lua

时间:2017-02-12 20:22:33

标签: lua

的朋友。

我需要有关编译此实用程序的说明。但我找不到信息。

我目前的情况是Win7,Lua 5.1(因为它是由我的儿子安装在我的机器上,但后来我会尝试使用Lua v5.3。## current)。

我在txt文件中看到过这个命令:

gcc string.c dbf_head.c dbf_ndx.c dbf_misc.c dbf_rec.c luadbase.c -shared -O2 -Wall -L/usr/local/lib -llua -ldl -lm -lnsl -o dbase.so

据我所知/ usr / local / lib是一个Linux目录,然后我改为./ 我认为这意味着我将在我编写的目录中查找库:在我的情况下,我说它们是在同一个目录中的库。 http://iie.fing.edu.uy/~vagonbar/gcc-make/gcc.htm

首先尝试:

我使用此内容创建make_win.bat(请参阅.DLL扩展名):

gcc string.c dbf_head.c dbf_ndx.c dbf_misc.c dbf_rec.c luadbase.c
-shared -O2 -Wall -L./ -llua -ldl -lm -lnsl -o dbase.dll


D:\lua-dbase-compiling>make_win

D:\lua-dbase-compiling>gcc string.c dbf_head.c dbf_ndx.c dbf_misc.c dbf_rec.c lu
adbase.c -shared -O2 -Wall -L./ -llua -ldl -lm -lnsl -o dbase.dll
dbf_rec.c: In function 'pack_dbf':
dbf_rec.c:131: warning: implicit declaration of function 'ftruncate'
luadbase.c:20:17: error: lua.h: No such file or directory
luadbase.c:21:21: error: lauxlib.h: No such file or directory
luadbase.c:23:24: error: compat-5.1.h: No such file or directory
luadbase.c:48: error: expected ')' before '*' token
luadbase.c:49: error: expected ')' before '*' token
luadbase.c:50: error: expected ')' before '*' token
luadbase.c:56: error: expected ')' before '*' token
luadbase.c:67: error: expected ')' before '*' token
luadbase.c:77: error: expected ')' before '*' token
luadbase.c:85: error: expected ')' before '*' token
luadbase.c:113: error: expected ')' before '*' token
luadbase.c:120: error: expected ')' before '*' token
luadbase.c:141: error: expected ')' before '*' token
luadbase.c:146: error: expected ')' before '*' token
luadbase.c:151: error: expected ')' before '*' token
luadbase.c:160: error: expected ')' before '*' token
luadbase.c:231: error: expected ')' before '*' token
luadbase.c:398: error: expected ')' before '*' token
luadbase.c:402: error: expected ')' before '*' token
luadbase.c:406: error: expected ')' before '*' token
luadbase.c:428: error: expected ')' before '*' token
luadbase.c:501: error: expected ')' before '*' token
luadbase.c:686: error: expected ')' before '*' token
luadbase.c:700: error: expected ')' before '*' token
luadbase.c:709: error: expected ')' before '*' token

因为它说找不到三个文件:lua.h,lauxlib.h和compat-5.1.h,然后我在m PC中查找它们。我找到了它们,然后将'copy'复制到我拥有DBASE.DLL源代码的目录。

第二次尝试:

我使用与第一次尝试相同的内容运行make_win.bat。

我收到了一长串错误和警告。第一个 - 你可以在下一行看到 - 表明我找不到我复制的三个文件。

D:\lua-dbase-compiling>make_win

D:\lua-dbase-compiling>gcc string.c dbf_head.c dbf_ndx.c dbf_misc.c dbf_rec.c lu
adbase.c -shared -O2 -Wall -L./ -llua -ldl -lm -lnsl -o dbase.dll
dbf_rec.c: In function 'pack_dbf':
dbf_rec.c:131: warning: implicit declaration of function 'ftruncate'
In file included from luadbase.c:20:
lua.h:16:21: error: luaconf.h: No such file or directory
In file included from luadbase.c:20:
lua.h:99: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'lua_Nu
mber'
lua.h:103: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'lua_I
nteger'
lua.h:110: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'lua_S
tate'
lua.h:111: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'

In file included from luadbase.c:21:
lauxlib.h:42: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'vo
id'
lauxlib.h:44: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'vo
id'
lauxlib.h:46: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'in
t'
lauxlib.h:47: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'in
t'

luadbase.c: In function 'luaM_tostring':
luadbase.c:58: warning: implicit declaration of function 'lua_touserdata'
luadbase.c:63: warning: implicit declaration of function 'lua_pushfstring'
luadbase.c:63: warning: implicit declaration of function 'lua_tolstring'
luadbase.c: In function 'luaM_regconst':
luadbase.c:68: warning: implicit declaration of function 'lua_pushstring'
luadbase.c:69: warning: implicit declaration of function 'lua_pushnumber'
luadbase.c:70: warning: implicit declaration of function 'lua_rawset'
luadbase.c: In function 'luaM_setmeta':
luadbase.c:78: warning: implicit declaration of function 'lua_getfield'

然后我决定复制Lua v.5.1.4的所有来源以及compat-5.1的更多来源(不在同一来源中)。

第三次尝试:

我使用与第一次和第二次尝试相同的内容运行make_win.bat。

错误很少,只有七行。

D:\lua-dbase-compiling>gcc string.c dbf_head.c dbf_ndx.c dbf_misc.c dbf_rec.c lu
adbase.c -shared -O2 -Wall -L./ -llua -ldl -lm -lnsl -o dbase.dll
dbf_rec.c: In function 'pack_dbf':
dbf_rec.c:131: warning: implicit declaration of function 'ftruncate'
ld: cannot find -llua
ld: cannot find -ldl
ld: cannot find -lnsl

由于我不是专业的C程序员,我决定压制这三个论点:-llua -ldl -lnsl在可运行的句子中。

第四次尝试:

现在句子是:

gcc string.c dbf_head.c dbf_ndx.c dbf_misc.c dbf_rec.c luadbase.c -shared -O2 -Wall -L./ -lm -o dbase.dll

我遇到了很多错误。我没有第一行:

C:\ Users \ user \ AppData \ Local \ Temp \ ccwaAh3E.o:luadbase.c :(。text + 0x1f8):undefined 引用`lua_tolstring'

C:\ Users \ user \ AppData \ Local \ Temp \ ccwaAh3E.o:luadbase.c :(。text + 0x210):undefined 引用lua_tolstring' C:\Users\user\AppData\Local\Temp\ccwaAh3E.o:luadbase.c:(.text+0x220): undefined reference to lua_rawset' C:\ Users \ user \ AppData \ Local \ Temp \ ccwaAh3E.o:luadbase.c :(。text + 0x230):undefined 引用lua_settop' C:\Users\user\AppData\Local\Temp\ccwaAh3E.o:luadbase.c:(.text+0x240): undefined reference to lua_next' C:\ Users \ user \ AppData \ Local \ Temp \ ccwaAh3E.o:luadbase.c :(。text + 0x254):undefined 引用lua_settop' C:\Users\user\AppData\Local\Temp\ccwaAh3E.o:luadbase.c:(.text+0x264): undefined reference to lua_objlen' C:\ Users \ user \ AppData \ Local \ Temp \ ccwaAh3E.o:luadbase.c :(。text + 0x27e):undefined 引用lua_pushboolean' C:\Users\user\AppData\Local\Temp\ccwaAh3E.o:luadbase.c:(.text+0x28e): undefined reference to lua_pushstring' C:\ Users \ user \ AppData \ Local \ Temp \ ccwaAh3E.o:luadbase.c :(。text + 0x2ac):undefined 引用lua_tonumber' C:\Users\user\AppData\Local\Temp\ccwaAh3E.o:luadbase.c:(.text+0x2bf): undefined reference to lua_settop' C:\ Users \ user \ AppData \ Local \ Temp \ ccwaAh3E.o:luadbase.c :(。text + 0x31b):undefined 参考`lua_rawgeti' C:\ Users \ user \ AppData \ Local \ Temp \ ccwaAh3E.o:luadbase.c :(。text + 0x336):undefined

我不明白。 我在目录中看不到任何DLL。

我不知道如何继续。

任何帮助都将不胜感激。

感谢您阅读此问题。

HERNAN CANO M。

0 个答案:

没有答案