我正在尝试为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]我该如何解决这个问题呢?
发布于 2014-09-13 05:47:06
我转过身来:
#include <stdio.h>
int main() { printf("Ok\n"); return(0); }进入:
#include <stdio.h>
int main() {
printf("Ok\n");
return(0);
}然后手动运行编译命令,查看哪一行真正包含语法错误。
发布于 2014-09-16 17:15:43
这看起来像是来自您的shell而不是编译器的错误。特别是因为对于语法错误,gcc不会返回"status 2“,但bash会。出现这个问题是因为您交叉编译了一个名为./try的mips64程序。您期望./Configure如何在您的主机pc上执行它?
https://stackoverflow.com/questions/25810878
复制相似问题