我正在尝试为 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);
}
然后手动运行编译命令,看看哪一行确实包含语法错误。
关于c - 当我尝试交叉编译 mips64 的 libperl 时,为什么会出现语法错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25810878/