clinuxarmv7

compile gcc for armv7l from debian in linux


I'm using GCC version 10.2.1 in Linux Debian (x86-64).

I write this C code:

#include <stdio.h>

int main() {
  printf("Hello World!");
  return 0;
}

Now my question is how can I compile and run this code for armv7l?

Target system Is a evaluation board


Solution

  • you can use arm-linux-gnueabihf-gcc hello.c -o hello command. And before you should install arm-linux-gnueabihf-gcc in your linux system .

    here is full sample that work for me