错误"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