[英]Why do I get a syntax error when I try to cross compile libperl for mips64?
我正在尝试为mips64交叉编译net-snmp
为此,我需要libperl
库。 我尝试使用以下命令为mips64配置libperl
:
./Configure -Dcc=/home/toby/x-tools/mips64-n64-linux-gnu/bin/mips64-n64-linux-gnu-gcc -Dprefix=/home/toby/perl
但我收到以下错误:
Checking your choice of C compiler and flags for coherency...
I've tried to compile and run the following simple program:
#include <stdio.h>
int main() { printf("Ok\n"); return(0); }
I used the command:
/home/toby/x-tools/mips64-n64-linux-gnu/bin/mips64-n64-linux-gnu-gcc -o try -O -I/usr/local/include try.c
./try
and I got the following output:
./try: 1: Syntax error: "(" unexpected
The program compiled OK, but exited with status 2.
(The supplied flags or libraries might be incorrect.)
You have a problem. Shall I abort Configure [y]
我怎样才能解决这个问题?
我会转:
#include <stdio.h>
int main() { printf("Ok\n"); return(0); }
进入:
#include <stdio.h>
int main() {
printf("Ok\n");
return(0);
}
然后手动运行compile命令以查看哪一行真正包含语法错误。
这看起来像是来自您的Shell而不是编译器的错误。 特别是因为gcc不会针对语法错误返回“状态2”,但是bash会返回。 发生问题是因为您已经为mips64交叉编译了一个名为./try的程序。 您如何期望./Configure在您的主机PC上执行它? –个人
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.