1 Reply Latest reply on Apr 3, 2015 8:42 AM by Intel_Peter

    How to compile programs over Galileo Terminal

    Galileo_User

      Hi All ,

       

      I have been using  the Galileo for some days . I am just stuck with the toolchain part . My requirement is very simple , i want to manually build my c application over terminal .

      I have created my program in VIM editor. Now just want to build it at terminal . I have got many of your valuable comments over using uclibc or eglibc compiler but i am not able to

      understand how can use these to compile my application . Can you please sugegst some basic instruction which i can follow to compile my program over terminal . I am not really interested in using eclipse or Arduino  for all these things . I want to do it manually over terminal.

        • 1. Re: How to compile programs over Galileo Terminal
          Intel_Peter

          Hello Galileo_User,

           

          In order to compile a C application directly from the Galileo's Linux console, you'll have to have a working SD card Linux image, and an internet connection. Then you can install the GCC package from AlexT's repo, if you haven't configured your Galileo to use it, you can go to http://alextgalileo.altervista.org/package-repo-configuration-instructions.html to learn how to do it. But to sum up you'll have to type:

           

          echo src/gz all    http://repo.opkg.net/galileo/repo/all > /etc/opkg/base-feeds.conf
          echo src/gz clanton http://repo.opkg.net/galileo/repo/clanton >> /etc/opkg/base-feeds.conf
          echo src/gz i586    http://repo.opkg.net/galileo/repo/i586 >> /etc/opkg/base-feeds.conf
          opkg update
          opkg install gcc
          

          When it's done installing you'll be able to compile a C application. But in order to run you script you have to create a compiled file, for example if you are trying to run the following code:

           

          int main()
          {
            printf("Hello World!\n");
          }
          

          You have to create a compiled file with the following line:

           

          gcc hello.c -o output
          

           

          And if you want to run it you have to type:

           

          ./output
          

           

          An its output should be

           

          Hello World!
          

           

          Peter.