Question: I've recently installed a `mips-linux-gnu-gcc` crosstool in my linux machine which is based on i686. When I want to compile some codes, it showed me that error.

Every installing step was followed by <http://developer.mips.com/tools/compilers/open-source-toolchain-linux/>

After I installed the crosstool, I wrote a simple helloworld C file like this:

```
    #include<stdio.h>
    int main(void)
    {
        printf("Hello World!\n");
        return 0;
    }

```

But when I run:

```
    /mips-linux-gnu-gcc hello.c -o hello -static

```

The compiler just print error:

```
    bash: ./mips-linux-gnu-gcc: cannot execute binary file

```

I'm wondering maybe I've made some mistakes in some steps, but I can't figure it out.

Maybe some of you can help me, I'm confused by the problem.

Answer: 
The compiler you downloaded from MIPS is a 64-bit executable. Are you running a 32-bit host?

If you need a cross compiler for a 32-bit host targeting MIPS GNU/Linux, consider using the Sourcery CodeBench Lite compiler for MIPS GNU/Linux targets:

[Sourcery CodeBench Lite for MIPS GNU/Linux](http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/mips-gnu-linux)

The link to the Sourcery CodeBench tools above comes from the MIPS pages just one level up from the link you provided:

[MIPS Compilers Page](http://developer.mips.com/tools/compilers/)
It looks like the `mips-linux-gnu-gcc` binary does not match the architecture of the machine you are trying to run it on. This might be something like a 32/64 bit mismatch. 

Try using the free Mentor/Codesourcery MIPS gnu/gcc cross compilation tool chain instead. You can download from [here](http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/).