compile gcc for armv7l from debian in linux

Issue

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 compile and run this code for armv7l
?
Target system Is a evaluation board
thank you

Solution

you can use arm-linux-gnueabihf-gcc hello.c -o hello command . and befor you should install arm-linux-gnueabihf-gcc in your linux system .

here is full sample that work for me

Answered By – reza rezaee

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published