我想跨編譯net-snmp
爲mips64,爲了做到這一點,我需要libperl
庫。我試着用下面的命令來配置libperl
爲MIPS64:當我嘗試爲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]
我怎樣才能解決這個問題?
這看起來像你的外殼,而不是編譯器的錯誤。特別是因爲gcc不會返回語法錯誤的「狀態2」,但bash的確如此。發生這個問題是因爲你有**交叉編譯**一個叫做'。/ try'的程序用於mips64。你如何期望'./configure'在你的** host ** pc上執行它? – indiv 2014-09-12 21:58:24
啊當然!謝謝。 – toocou 2014-09-15 08:31:38
@indiv您應該將其作爲答案發布。 – ThisSuitIsBlackNot 2014-09-15 17:03:35