錯誤"file is not of required architecture"
暗示您試圖混合體繫結構。
檢查/usr/local/lib/liblua.a
的體系結構並確保它與您嘗試構建的體系結構或對象相匹配。
E.g.
我們有一個i386的對象:
==== cat fun.c ====
#include <stdio.h>
void fun()
{
printf("%s", "foobar\n");
}
gcc -arch i386 -c fun.c -o fun.o
如果我們嘗試使用它編譯x86_64的對象(在Mac OS X默認架構)時:
===== cat test.c ==
extern void fun();
int main()
{
fun();
}
我們得到:
$ gcc test.c fun.o
ld: warning: ignoring file fun.o, file was built for i386 which is not the architecture being linked (x86_64)
Undefined symbols for architecture x86_64:
"_fun", referenced from:
_main in ccXVCQhG.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
'_Lua_Call'不是Lua C API中的符號。 – lhf 2012-04-16 12:21:23
酷,但它的編譯和它的工作,與馬科斯錯誤ld的主要問題:警告:在/usr/local/lib/liblua.a,文件不是所需的體系結構 – TotallyStuck 2012-04-16 13:25:55
如果您已經編譯和安裝從源下載的Lua http://www.lua.org這不應該發生。 – lhf 2012-04-16 13:26:56