我想交叉編譯一個簡單的程序,該程序在我的x86_64上使用libncurses。目標系統是MIPS。crosstool-ng - stdio.h:沒有這樣的文件或目錄
我crosstool-ng-1.20構建了罰款(樣本MIPS-未知精靈)
但是,一個簡單的Hello World非常結束。
#include <stdio.h>
int main(void)
{
printf("OH HAI.\n");
return 0;
}
-
x86host:~/toolchain$ mips-unknown-elf-gcc -o hello hello.c
hello.c:1:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^
compilation terminated.
我清楚地做一些可怕的錯誤在這裏,但我從哪裏開始?
[編輯]
謝謝markgz。 Codesourcery正是我所需要的。
mips-linux-gnu-gcc.exe -static -o helloStatic hello.c
概念驗證完成。現在編譯我的ncurses程序。
[Switch:/]$ file /mnt/sd3/user/helloStatic
/mnt/sd3/user/helloStatic: ELF 32-bit MSB executable, MIPS, MIPS32 rel2 version 1,
statically linked, for GNU/Linux 2.6.16, with unknown capability
0x41000000 = 0xf676e75, not stripped
[Switch:/]$ uname -a
Linux Switch 2.6.32.59-cavium-octeon2.cge-cavium-octeon #1
SMP PREEMPT Fri May 10 11:48:14 PDT 2013 mips64 GNU/Linux
[Switch:/]$ /mnt/sd3/user/helloStatic
HOLIDAYS ARE COMING.