0

I have a binary file that shows [URL] [port number] when I run it on Linux. I want the same thing to happen in the Pi, but instead I get

cannot execute binary file

Is there anything I could do to get the output without using the cross compiler? If not please help me in using the cross compiler!!

Jacobm001
  • 11,904
  • 7
  • 47
  • 58
ashwin
  • 1
  • 2

3 Answers3

1

Is there anything I could do to get the output without using the cross compiler?

Yes, you can use the native compiler on the pi.

If not please help me in using the cross compiler!!

This is not a coherent or complete question.

goldilocks
  • 60,325
  • 17
  • 117
  • 234
1

I suspect that the program you are running is developed for a Intel based computer. A program compiled on that computer will not run native on the Raspberry Pi.

You will need to port and compile that code on the Raspberry Pi.

Romonaga
  • 21
  • 1
1

Is there anything I could do to get the output without using the cross compiler?

Yes, as Goldilocks mentioned, you can compile the software directly on the Raspberry Pi itself. Short of that, you need to setup a cross compiler. How you do that is well outside the scope of this site. This is not a tutorial service.

Your problem seems to stem from the a lack of understanding the Raspberry Pi's processor. Unlike your desktop or laptop computer that you're compiling the program on (Intel x86), the Raspberry Pi 2 runs an ARM Cortex A-7 processor. These two things are fundamentally different, and are not compatible. Our blog post goes into that in more detail.

Jacobm001
  • 11,904
  • 7
  • 47
  • 58