wiki:newport/nativecompile

Native Compile on Newport

To natively compile a .c file on a Newport board using Ubuntu, follow the instructions:

  • First, install build-essential
    apt-get update
    apt-get install build-essential
    
  • Create a hello world file using a text editor like vi or similar: (hello.c)
    #include <stdio.h>
    
    int main(void)
    {
    printf("hello, world\n");
    }
    
  • Compile the file:
    root@xenial-newport:~# gcc -o hello helloworld.c
    
  • Run the file
    root@xenial-newport:~# ./hello
    hello, world
    
Last modified 2 months ago Last modified on 03/12/2019 05:51:11 PM