Command for Compiling c program code in terminal

gcc command is not working in endless terminal. Is there any other command to compile the code?

@Allu_Ranjith

We don’t include developer tools such as GCC by default in Endless OS. But you can use Flatpak as a development environment. Follow the instructions at http://flatpak.org/developer.html to install and run org.gnome.Sdk//3.22 and that will give you a development environment with GCC and other developer tools.

1 Like

Hi.

I have already installed org.gnome.Sdk:
# flatpak install gnome org.gnome.Platform//3.22 org.gnome.Sdk//3.22
erro: org.gnome.Sdk/x86_64/3.22 already installed

But can’t find the binary anywhere on the system:
# find / -xdev -iname ‘gcc’ -exec file {} ;
find: File system loop detected; /sysroot/ostree/deploy/eos/deploy/307c15909ca8f01ddb9a8e37e6f27cf3d96637504625d59882b1585c9335cb31.0' is part of the same file system loop as/’.
/sysroot/ostree/deploy/eos/deploy/9ac676676f6e6f110bd8e56ffddd083b3a0199e117964f979e1bc70e1c83792a.0/usr/lib/gcc: directory
/sysroot/ostree/deploy/eos/deploy/9ac676676f6e6f110bd8e56ffddd083b3a0199e117964f979e1bc70e1c83792a.0/usr/share/bash-completion/completions/gcc: ASCII text
/sysroot/flatpak/.removed/removed-80e1b08461531ff7831b20bc4c4618b96bdbe83498f67ca4ca523812788cf884-YFGV0Y/files/lib/gcc: directory
/sysroot/flatpak/runtime/com.endlessm.Platform/x86_64/eos3.1/9bc6ac53b17d35c0322c41443e810eae1745c74d118660b7d54d59cd8fd5ab6f/files/lib/gcc: directory
/sysroot/flatpak/runtime/org.gnome.Sdk/x86_64/3.22/7ec9b226b95c0d9cb1efbfbe24b439c85bac36dda7b36e1ce2d34299dbc0c75b/files/include/atomic_ops/sysdeps/gcc: directory
/sysroot/flatpak/runtime/org.gnome.Sdk/x86_64/3.22/7ec9b226b95c0d9cb1efbfbe24b439c85bac36dda7b36e1ce2d34299dbc0c75b/files/lib/gcc: directory
/sysroot/flatpak/runtime/org.gnome.Sdk/x86_64/3.22/7ec9b226b95c0d9cb1efbfbe24b439c85bac36dda7b36e1ce2d34299dbc0c75b/files/lib/gcc/gcc: directory
/sysroot/flatpak/runtime/org.gnome.Sdk/x86_64/3.22/7ec9b226b95c0d9cb1efbfbe24b439c85bac36dda7b36e1ce2d34299dbc0c75b/files/bin/gcc: symbolic link to x86_64-unknown-linux-gcc
/sysroot/flatpak/runtime/org.freedesktop.Sdk/x86_64/1.4/d6a8c46e30e0518c8f6c8278edf0bd59800193494bbdaeee7393646385247445/files/include/atomic_ops/sysdeps/gcc: directory
/sysroot/flatpak/runtime/org.freedesktop.Sdk/x86_64/1.4/d6a8c46e30e0518c8f6c8278edf0bd59800193494bbdaeee7393646385247445/files/lib/gcc: directory
/sysroot/flatpak/runtime/org.freedesktop.Sdk/x86_64/1.4/d6a8c46e30e0518c8f6c8278edf0bd59800193494bbdaeee7393646385247445/files/lib/gcc/gcc: directory
/sysroot/flatpak/runtime/org.freedesktop.Sdk/x86_64/1.4/d6a8c46e30e0518c8f6c8278edf0bd59800193494bbdaeee7393646385247445/files/bin/gcc: symbolic link to x86_64-unknown-linux-gcc
/usr/lib/gcc: directory
/usr/share/bash-completion/completions/gcc: ASCII text

I think there’s something missing in this documentation, can you guys help me with having GCC on EndlessOS?

This is the system I’m using:
# uname -a
Linux endless 4.8.0-39-generic #42+dev175.25bb934beos3.1.2-Endless SMP Thu Mar 9 14:37:35 UTC 2 x86_64 GNU/Linux

Thank you in advance.

1 Like

Hi,

The GCC tools won’t be available on just the base system; you need to enter the “sandbox” provided by the Flatpak development environment. You can use the gnome-builder IDE to do this, but you can also enter it manually from the command line:

flatpak run --command=bash -d --filesystem=home org.gnome.Sdk

This will open a terminal session inside the sandbox, and you can type exit to go back to the base system again.

1 Like

@MichaelChampigny I see you’ve deleted your post so I assume you solved the problem, but I may be able to leave some help for future readers:

The flatpak list command will only list installed apps; what you are using is called a “runtime”, and you can see which ones are installed with the command

flatpak list --runtime

From your error message it looks like you installed the 3.24 version of org.gnome.Sdk but the tools were expecting the master version. In that case, add --branch=3.24 to your flatpak run invocation, or provide it as a suffix to the runtime name:

flatpak run --command=bash -d --filesystem=home org.gnome.Sdk//3.24
1 Like

Thanks, I wanted to move it to a standalone topic but didn’t see a way to achieve that, so deleted the post. But yes, good to keep it around for reference.

1 Like

Why is it necessary to have version 3.24, rather than the current version (e.g. 3.28)? Anyway, it works with 3.24, so thank you.

You can use whatever version you want. 3.24 was just an example.

is this resolved…? but i can’t figure out exact process here
can anyone plz explain me. i was trying the same from past hours of time .