How to create executable from c source file? [Solved]

Discussions Regarding Software

Moderator: Moderators

Post Reply
User avatar
linuxfluesterer
Old Dear Hen
Posts: 873
Joined: Thu Sep 20, 2012 19:47
Location: Germany

How to create executable from c source file? [Solved]

Post by linuxfluesterer » Mon Jan 22, 2018 16:57

Hallo guys.
I just simply want to execute a given c source file, which I need to compile (I assume with gcc???) to create an executable then.
I found this website:
https://www.cyberciti.biz/faq/howto-com ... pile-demo/
but none of the three alternatives were working.
When I start this:

Code: Select all

gcc packet_sniff_raw_subodh.c -o packet_sniff_raw_subodh.o
I receive this:

Code: Select all

gcc-config: error: could not run/locate 'gcc'
Despite the errors, I already have installed gcc, gcc-ar gcc-config, gccgo gccgo-4.9.3, gcc-nm and gcc-ranlib.
And I have some experience with complete source directories including make files, where I can create executable files with the three steps:

Code: Select all

./configure
make
make install
btw, I also worked with cmake.
The thing is, in this case here I have just only a single .c file. How do I get it executable?
Thank you in advance.

-Linuxfluesterer (I love KDE...)
Last edited by linuxfluesterer on Mon Jan 22, 2018 19:25, edited 1 time in total.
Take away Facebook from me and let there be real people again...

User avatar
sabayonino
Sagely Hen
Posts: 3279
Joined: Sun Sep 21, 2008 1:12
Location: Italy
Contact:

Re: How to create executable from c source file?

Post by sabayonino » Mon Jan 22, 2018 17:32

Install the full gcc-suite

Code: Select all

# equo i @build-essentials
:?:
[Che Cos'è Il Calcolo Distribuito (BOINC)

BOINC ready ! Sabayon+BOINC = BILD ,my Sabayon spin :cyclops: - Ready to crunch for the Science everywhere :)

User avatar
linuxfluesterer
Old Dear Hen
Posts: 873
Joined: Thu Sep 20, 2012 19:47
Location: Germany

Re: How to create executable from c source file?

Post by linuxfluesterer » Mon Jan 22, 2018 19:25

sabayonino wrote:Install the full gcc-suite

Code: Select all

# equo i @build-essentials
Grazie, Sabayonino. That was it, the build-essential were missing. I thought I had installed them (long time ago). Anyway, what does the '@' mean before 'build'?

I will close this thread.

-Linuxfluesterer (I love KDE...)
Take away Facebook from me and let there be real people again...

User avatar
sabayonino
Sagely Hen
Posts: 3279
Joined: Sun Sep 21, 2008 1:12
Location: Italy
Contact:

Re: How to create executable from c source file? [Solved]

Post by sabayonino » Mon Jan 22, 2018 19:43

"@build-essentials" is a set of packages

There are several "sets" in entropy

Code: Select all

# equo q  sets

Code: Select all

$ equo q sets
╠  @@ Ricerca Package Set
╠   #1 X
╠     x11-apps/setxkbmap
╠     x11-apps/xdm
╠     x11-apps/xhost
╠     x11-base/xorg-server
╠     x11-drivers/xf86-input-evdev
╠     x11-drivers/xf86-input-joystick
╠     x11-drivers/xf86-input-libinput
╠     x11-drivers/xf86-input-mtrack
╠     x11-drivers/xf86-input-synaptics
╠     x11-drivers/xf86-input-vmmouse
╠     x11-drivers/xf86-input-void
╠     x11-drivers/xf86-input-wacom
╠     x11-drivers/xf86-video-amdgpu
╠     x11-drivers/xf86-video-ast
╠     x11-drivers/xf86-video-ati
╠     x11-drivers/xf86-video-dummy
╠     x11-drivers/xf86-video-fbdev
╠     x11-drivers/xf86-video-glint
╠     x11-drivers/xf86-video-intel
╠     x11-drivers/xf86-video-nouveau
╠     x11-drivers/xf86-video-nv
╠     x11-drivers/xf86-video-openchrome
╠     x11-drivers/xf86-video-qxl
╠     x11-drivers/xf86-video-r128
╠     x11-drivers/xf86-video-siliconmotion
╠     x11-drivers/xf86-video-tdfx
╠     x11-drivers/xf86-video-vesa
╠     x11-drivers/xf86-video-vmware
╠     x11-drivers/xf86-video-voodoo
╠   #2 build-essentials
╠     sys-devel/autoconf
╠     sys-devel/automake
╠     sys-devel/gcc
╠     virtual/os-headers
╠     virtual/pkgconfig
╠   #3 enlightenment
╠     @X
╠     @wireless
╠     app-misc/sabayon-skel
╠     media-plugins/alsa-plugins
╠     x11-wm/enlightenment:0.17
╠   #4 entropy
╠     app-admin/equo
╠     app-admin/matter
╠     app-admin/rigo
╠     app-misc/magneto-loader
╠     kde-misc/magneto-kde
╠     sys-apps/entropy
╠     sys-apps/entropy-server
╠     sys-apps/magneto-core
╠     sys-apps/rigo-daemon
╠     x11-misc/magneto-gtk
╠     x11-misc/magneto-gtk3
╠   #5 entropy-no-kde
╠     app-admin/equo
╠     app-admin/matter
╠     app-admin/rigo
╠     app-misc/magneto-loader
╠     sys-apps/entropy
╠     sys-apps/entropy-server
╠     sys-apps/magneto-core
╠     sys-apps/rigo-daemon
╠     x11-misc/magneto-gtk
╠     x11-misc/magneto-gtk3
╠   #6 fluxbox
╠     @X
╠     x11-wm/fluxbox
╠   #7 gnome
╠     @X
╠     app-arch/file-roller
╠     app-cdr/brasero
╠     app-misc/sabayon-skel
╠     app-text/evince
╠     gnome-base/gdm
╠     gnome-base/gnome
╠     gnome-base/gnome-shell
╠     gnome-extra/nm-applet
╠     mail-client/evolution
╠     media-gfx/eog
╠     media-video/totem
╠     x11-apps/xdm
╠     x11-themes/sabayon-artwork-gnome
╠   #8 gst-plugins
╠     media-plugins/gst-plugins-assrender
╠     media-plugins/gst-plugins-cdio
╠     media-plugins/gst-plugins-faac
╠     media-plugins/gst-plugins-mpeg2dec
╠     media-plugins/gst-plugins-mplex
╠     media-plugins/gst-plugins-x264
╠     media-plugins/gst-plugins-xvid
╠   #9 gst-plugins-extra
╠     media-libs/gst-plugins-good
╠     media-plugins/gst-plugins-dts
╠     media-plugins/gst-plugins-dvdread
╠     media-plugins/gst-plugins-pulse
╠     media-plugins/gst-plugins-soup
╠   #10 ime-fonts
╠     media-fonts/arphicfonts
╠     media-fonts/ja-ipafonts
╠     media-fonts/vlgothic
╠   #11 ime-fonts-support
╠     app-i18n/ibus-anthy
╠     app-i18n/ibus-hangul
╠     app-i18n/ibus-m17n
╠     app-i18n/ibus-pinyin
╠   #12 intel-kernels
╠     sys-kernel/linux-sabayon
╠     sys-kernel/sabayon-sources
╠   #13 intel-kernels-4.1
╠     sys-kernel/linux-sabayon:4.1
╠     sys-kernel/sabayon-sources:4.1
╠   #14 intel-kernels-4.14
╠     sys-kernel/linux-sabayon:4.14
╠     sys-kernel/sabayon-sources:4.14
╠   #15 intel-kernels-4.4
╠     sys-kernel/linux-sabayon:4.4
╠     sys-kernel/sabayon-sources:4.4
╠   #16 intel-kernels-4.9
╠     sys-kernel/linux-sabayon:4.9
╠     sys-kernel/sabayon-sources:4.9
╠   #17 lxde
╠     @X
╠     @wireless
╠     app-misc/sabayon-skel
╠     lxde-base/lxde-meta
╠     lxde-base/lxdm
╠   #18 packagekit
╠     app-admin/packagekit
╠     app-admin/packagekit-base
╠     app-admin/packagekit-gtk
╠   #19 sabayon-artwork
╠     x11-themes/sabayon-artwork-core
╠     x11-themes/sabayon-artwork-extra
╠     x11-themes/sabayon-artwork-gnome
╠     x11-themes/sabayon-artwork-grub
╠     x11-themes/sabayon-artwork-isolinux
╠     x11-themes/sabayon-artwork-lxde
╠   #20 wireless
╠     net-wireless/b43-fwcutter
╠     net-wireless/bcm43xx-fwcutter
╠     net-wireless/rfkill
╠     net-wireless/wireless-tools
╠     sys-firmware/b43-firmware
╠     sys-firmware/ipw2100-firmware
╠     sys-firmware/ipw2200-firmware
╠     sys-firmware/zd1201-firmware
╠     sys-firmware/zd1211-firmware
╠     sys-kernel/linux-firmware
╠   #21 xfce
╠     @X
╠     @wireless
╠     app-editors/leafpad
╠     app-misc/sabayon-skel
╠     media-plugins/alsa-plugins
╠     x11-themes/elementary-icon-theme
╠     xfce-base/xfce4-appfinder
╠     xfce-base/xfce4-meta
╠     xfce-extra/xfce4-power-manager
╠     xfce-extra/xfce4-taskmanager
"@" is a set of something

@build-essentials means to install following packages

Code: Select all

╠   #2 build-essentials
╠     sys-devel/autoconf
╠     sys-devel/automake
╠     sys-devel/gcc
╠     virtual/os-headers
╠     virtual/pkgconfig

@xfce set will go to install "@X" set + "@wireless" set and other packages required by xfce

Code: Select all

╠   #21 xfce
╠     @X
╠     @wireless
╠     app-editors/leafpad
╠     app-misc/sabayon-skel
╠     media-plugins/alsa-plugins
╠     x11-themes/elementary-icon-theme
╠     xfce-base/xfce4-appfinder
╠     xfce-base/xfce4-meta
╠     xfce-extra/xfce4-power-manager
╠     xfce-extra/xfce4-taskmanager
[Che Cos'è Il Calcolo Distribuito (BOINC)

BOINC ready ! Sabayon+BOINC = BILD ,my Sabayon spin :cyclops: - Ready to crunch for the Science everywhere :)

User avatar
linuxfluesterer
Old Dear Hen
Posts: 873
Joined: Thu Sep 20, 2012 19:47
Location: Germany

Re: How to create executable from c source file? [Solved]

Post by linuxfluesterer » Mon Jan 22, 2018 20:31

sabayonino wrote:"@build-essentials" is a set of packages
Something else that I've learned, thanks. Though, I remember, in the past, Sabayon sets were not signed with a "@" in the past. Anyway, good idea. On the other hand, I was not able to make a 'search' for such a set with equo s. I mean, when I enter:

Code: Select all

equo s build-essentials
then I don't receive any result. See here:

Code: Select all

equo s build-essential
╠  @@ Suche...
╠   Schlüsselwörter:  build-essential
╠   Gefunden:         0 Einträge
-Linuxfluesterer (I love KDE...)
Take away Facebook from me and let there be real people again...

gentmixer
Simple Hen
Posts: 60
Joined: Wed Jan 17, 2018 17:21

Re: How to create executable from c source file? [Solved]

Post by gentmixer » Mon Jan 22, 2018 21:39

Hi...
The "build-essential" is a set apps named "build-essential", not an individual package...

User avatar
sabayonino
Sagely Hen
Posts: 3279
Joined: Sun Sep 21, 2008 1:12
Location: Italy
Contact:

Re: How to create executable from c source file? [Solved]

Post by sabayonino » Mon Jan 22, 2018 21:43

Code: Select all

LANG="en_US" equo q --help

Code: Select all

...
   sets                search package sets
...

Code: Select all

# equo q sets
gives a list of available sets configuried inside entropy.
"Sets" are not in repositories
[Che Cos'è Il Calcolo Distribuito (BOINC)

BOINC ready ! Sabayon+BOINC = BILD ,my Sabayon spin :cyclops: - Ready to crunch for the Science everywhere :)

Post Reply