好吧,我们有的是:
在C上编写的程序,在Linux和MacOSX (豹)中编译和运行,没有问题。我今天嵌入了lua密码。Linux:从源代码编译Lua5.1。所有的工作和编译都没有任何问题。Macos:编译了相同的Lua5.1软件包。
与.llua有关。
启动编译并得到一个错误:
CC=gcc-4.0
ld:警告:在/usr/local/lib/libla.a中,文件不是必需的体系结构
也尝试重新安装,完成从宏端口的删除和安装。一样的。
有什么解决办法吗?
发布于 2012-04-20 09:55:45
错误"file is not of required architecture"暗示了一个事实,即您正在尝试混合体系结构。
检查/usr/local/lib/liblua.a的体系结构,并确保它与您要构建的体系结构或对象相匹配。
例如。
我们有一个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中的默认架构):
===== 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 statushttps://stackoverflow.com/questions/10173423
复制相似问题