I bought a Chinese P2P camera and there was no MJPEG stream, so I wanted to compile mjpg-streamer for it. Here's my CPU's info:# cat /proc/cpuinfo system type             : Ralink SoCprocessor               : 0cpu model               : MIPS 24K V4.12BogoMIPS                : 239.61wait instruction        : yesmicrosecond timers      : yestlb_entries             : 32extra interrupt vector  : yeshardware watchpoint     : yesASEs implemented        : mips16 dspVCED exceptions         : not availableVCEI exceptions         : not available# uname -aLinux (none) 2.6.21 #878 Tue Oct 29 09:53:25 CST 2013 mips unknownI tried to use Sourcery CodeBench for MIPS GNU/Linux (latest version) and attempted to compile a simple 'Hello world' example with this command:$ mips-linux-gnu-gcc -Wall hello.c -o helloAfter execution I received the following message:# ./hello ./hello: line 1: ELF@04: not found./hello: line 2: syntax error: ( unexpectedNext I tried to recompile with this command:$ mips-linux-gnu-gcc -mips16 -Wall hello.c -o helloBut the result was:# ./hello ./hello: line 1: syntax error: ( unexpectedAm I using the wrong compiler, if so which is the correct one?Am I missing or using the wrong arguments?EDIT:$readelf -h HKIPC #Extracted file from the deviceELF Header:  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00   Class:                             ELF32  Data:                              2's complement, little endian  Version:                           1 (current)  OS/ABI:                            UNIX - System V  ABI Version:                       0  Type:                              EXEC (Executable file)  Machine:                           MIPS R3000  Version:                           0x1  Entry point address:               0x406420  Start of program headers:          52 (bytes into file)  Start of section headers:          643764 (bytes into file)  Flags:                             0x10001007, noreorder, pic, cpic, o32, mips2  Size of this header:               52 (bytes)  Size of program headers:           32 (bytes)  Number of program headers:         6  Size of section headers:           40 (bytes)  Number of section headers:         25  Section header string table index: 24$file HKIPC HKIPC: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked (uses shared libs), stripped-$readelf -h hello #Compiled with mips-linux-gnu-gcc -mips2 -EL -mabi=32 hello.c  -o helloELF Header:  Magic:   7f 45 4c 46 01 01 01 00 01 00 00 00 00 00 00 00   Class:                             ELF32  Data:                              2's complement, little endian  Version:                           1 (current)  OS/ABI:                            UNIX - System V  ABI Version:                       1  Type:                              EXEC (Executable file)  Machine:                           MIPS R3000  Version:                           0x1  Entry point address:               0x400430  Start of program headers:          52 (bytes into file)  Start of section headers:          2732 (bytes into file)  Flags:                             0x70001005, noreorder, cpic, o32, mips32r2  Size of this header:               52 (bytes)  Size of program headers:           32 (bytes)  Number of program headers:         8  Size of section headers:           40 (bytes)  Number of section headers:         34  Section header string table index: 31$file hellohello: ELF 32-bit LSB executable, MIPS, MIPS32 rel2 version 1, dynamically linked (uses shared libs), with unknown capability 0xf41 = 0x756e6700, with unknown capability 0x70100 = 0x1040000, not stripped
GCC (toolchain) for Ralink SoC - ELF not found and syntax error
gcc;cross compilation;mips