c - 当我尝试交叉编译 mips64 的 libperl 时,为什么会出现语法错误?

标签 c perl cross-compiling configure 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); 
 }

然后手动运行编译命令,看看哪一行确实包含语法错误。

关于c - 当我尝试交叉编译 mips64 的 libperl 时,为什么会出现语法错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25810878/

相关文章:

c - C中的 "Real Types"和 "Arithmetic Types"有什么区别?

c - scanf() 在 for 循环中被跳过

c++ - "Narrowing conversion from ' int ' to ' char ' inside { }"交叉编译时的合法值

windows - 在 Windows 主机上使用 Eclipse 开发嵌入式 Linux

python /赛通 : Using SciPy with Cython

c - 在 Racket 中,我可以在调用另一个函数后导出函数吗?

regex - 为什么在这个 Perl 正则表达式中 `\s+` 比 `\s\s*` 快得多?

arrays - 如何将简单(平面)数组转换为多维(2D)数组

C# 正则表达式替换和 *

linux 交叉编译链接器问题, undefined reference `g_thread_init' 和 `org_freedesktop_DBus_request_name'