C++ compiler?

Message
Author
User avatar
operadude
Posts: 849
Joined: Tue Nov 05, 2019 12:08 am

Re: C++ compiler?

#11 Post by operadude »

Adrian wrote: Sat Aug 05, 2023 10:32 am Just install build-essential if you need to build something. It's not on the ISO because it's not a dependency to any of the stuff that's there and not everybody compiles stuff and in general people who know how to compile stuff know how to install the compiler, it's really not hard, it takes a minute. If you really like it on the ISO, install it, take a snapshot and it will always be there.
Thanks for that!

I was also wondering why my C++ "Hello, World!" program was not working on MX-23, then I did this:

Code: Select all

$ which g++
opera-dude@GA-H270-HD3:~
$ apt policy g++
g++:
  Installed: (none)
  Candidate: 4:12.2.0-3
  Version table:
     4:12.2.0-3 500
        500 http://deb.debian.org/debian bookworm/main amd64 Packages
Questions:
For a learning C++, does one need "build-essential"?
And if only concerned about running C++ programs, does this suffice? :

Code: Select all

$ sudo apt install g++
[sudo] password for opera-dude:            
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  g++-12 libstdc++-12-dev
Suggested packages:
  g++-multilib g++-12-multilib gcc-12-doc libstdc++-12-doc
And if so, should one also install the suggested:

Code: Select all

g++-multilib
g++-12-multilib 
?

User avatar
Stevo
Developer
Posts: 14451
Joined: Fri Dec 15, 2006 7:07 pm

Re: C++ compiler?

#12 Post by Stevo »

build-essential will also install and configure essential tools, such as "make".

You don't need multilib packages unless you plan to cross-compile.
MXPI = MX Package Installer
QSI = Quick System Info from menu
The MX Test repository is mostly backports; not the same as Debian testing

User avatar
WyCKyD
Posts: 23
Joined: Sun Apr 14, 2019 2:20 am

Re: C++ compiler?

#13 Post by WyCKyD »

Here is some info about the computer that I am speaking about. Still not able to install the wifi driver because gcc isn't installed.

First, the system info:

Code: Select all

System:
  Kernel: 6.2.14-1-liquorix-amd64 [6.2-23~mx23+1] arch: x86_64 bits: 64 compiler: gcc v: 12.2.0 parameters: audit=0
    intel_pstate=disable hpet=disable rcupdate.rcu_expedited=1
    BOOT_IMAGE=/boot/vmlinuz-6.2.14-1-liquorix-amd64 root=UUID=<filter> ro quiet splash
  Desktop: KDE Plasma v: 5.27.5 wm: kwin_x11 vt: 7 dm: SDDM Distro: MX-23.1_KDE_x64 Libretto
    October 15 2023 base: Debian GNU/Linux 12 (bookworm)
Machine:
  Type: Desktop Mobo: ASRock model: B365M Pro4 serial: <superuser required>
    UEFI: American Megatrends v: P4.50 date: 07/30/2021
CPU:
  Info: model: Intel Core i3-8100 bits: 64 type: MCP arch: Coffee Lake gen: core 8 level: v3
    note: check built: 2018 process: Intel 14nm family: 6 model-id: 0x9E (158) stepping: 0xB (11)
    microcode: 0xF4
  Topology: cpus: 1x cores: 4 smt: <unsupported> cache: L1: 256 KiB desc: d-4x32 KiB; i-4x32 KiB
    L2: 1024 KiB desc: 4x256 KiB L3: 6 MiB desc: 1x6 MiB
  Speed (MHz): avg: 800 min/max: 800/3600 scaling: driver: acpi-cpufreq governor: ondemand cores:
    1: 800 2: 800 3: 800 4: 800 bogomips: 28800
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT disabled
  Type: mds mitigation: Clear CPU buffers; SMT disabled
  Type: meltdown mitigation: PTI
  Type: mmio_stale_data mitigation: Clear CPU buffers; SMT disabled
  Type: retbleed mitigation: IBRS
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: IBRS, IBPB: conditional, STIBP: disabled, RSB filling,
    PBRSB-eIBRS: Not affected
  Type: srbds mitigation: Microcode
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: NVIDIA GP107 [GeForce GTX 1050 Ti] vendor: Gigabyte driver: nouveau v: kernel
    non-free: 530.xx+ status: current (as of 2023-03) arch: Pascal code: GP10x process: TSMC 16nm
    built: 2016-21 pcie: gen: 1 speed: 2.5 GT/s lanes: 16 link-max: gen: 3 speed: 8 GT/s ports:
    active: HDMI-A-1 empty: DP-1, DVI-D-1, HDMI-A-2, HDMI-A-3 bus-ID: 01:00.0 chip-ID: 10de:1c82
    class-ID: 0300 temp: 33.0 C
  Device-2: Logitech Webcam C270 type: USB driver: snd-usb-audio,uvcvideo bus-ID: 1-3:2
    chip-ID: 046d:0825 class-ID: 0102 serial: <filter>
  Device-3: Sonix USB Camera type: USB driver: snd-usb-audio,uvcvideo bus-ID: 1-4:3
    chip-ID: 0c49:636b class-ID: 0102 serial: <filter>
  Display: x11 server: X.Org v: 1.21.1.7 with: Xwayland v: 22.1.9 compositor: kwin_x11 driver: X:
    loaded: modesetting unloaded: fbdev,vesa dri: nouveau gpu: nouveau display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.00x11.22") s-diag: 582mm (22.93")
  Monitor-1: HDMI-A-1 mapped: HDMI-1 model: Dell S2240T serial: <filter> built: 2013
    res: 1920x1080 hz: 60 dpi: 102 gamma: 1.2 size: 477x268mm (18.78x10.55") diag: 547mm (21.5")
    ratio: 16:9 modes: max: 1920x1080 min: 720x400
  API: OpenGL v: 4.3 Mesa 23.1.2-1~mx23ahs renderer: NV137 direct-render: Yes
Audio:
  Device-1: Intel 200 Series PCH HD Audio vendor: ASRock driver: snd_hda_intel bus-ID: 1-3:2
    v: kernel chip-ID: 046d:0825 alternate: snd_soc_avs bus-ID: 00:1f.3 class-ID: 0102
    chip-ID: 8086:a2f0 serial: <filter> class-ID: 0403
  Device-2: NVIDIA GP107GL High Definition Audio vendor: Gigabyte driver: snd_hda_intel v: kernel
    pcie: gen: 1 speed: 2.5 GT/s lanes: 16 link-max: gen: 3 speed: 8 GT/s bus-ID: 01:00.1
    chip-ID: 10de:0fb9 class-ID: 0403
  Device-3: Logitech Webcam C270 type: USB driver: snd-usb-audio,uvcvideo
  Device-4: Sonix USB Camera type: USB driver: snd-usb-audio,uvcvideo bus-ID: 1-4:3
    chip-ID: 0c49:636b class-ID: 0102 serial: <filter>
  Device-5: C-Media Blue Snowball type: USB driver: hid-generic,snd-usb-audio,usbhid
    bus-ID: 1-8:4 chip-ID: 0d8c:0005 class-ID: 0300 serial: <filter>
  API: ALSA v: k6.2.14-1-liquorix-amd64 status: kernel-api tools: alsamixer,amixer
  Server-1: PipeWire v: 0.3.65 status: active with: 1: pipewire-pulse status: active
    2: wireplumber status: active 3: pipewire-alsa type: plugin 4: pw-jack type: plugin
    tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Intel Ethernet I219-V vendor: ASRock driver: e1000e v: kernel port: N/A bus-ID: 00:1f.6
    chip-ID: 8086:15b8 class-ID: 0200
  IF: eth0 state: down mac: <filter>
Drives:
  Local Storage: total: 1.93 TiB used: 23.84 GiB (1.2%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/sda maj-min: 8:0 vendor: Seagate model: ST2000DM008-2FR102 size: 1.82 TiB
    block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s type: HDD rpm: 7200 serial: <filter>
    rev: 0001 scheme: GPT
  ID-2: /dev/sdb maj-min: 8:16 type: USB model: USB DISK 3.0 size: 115.36 GiB block-size:
    physical: 512 B logical: 512 B type: N/A serial: <filter> rev: PMAP scheme: MBR
  SMART Message: Unknown USB bridge. Flash drive/Unsupported enclosure?
Partition:
  ID-1: / raw-size: 1.82 TiB size: 1.79 TiB (98.37%) used: 14.28 GiB (0.8%) fs: ext4 dev: /dev/sda2
    maj-min: 8:2
  ID-2: /boot/efi raw-size: 256 MiB size: 252 MiB (98.46%) used: 274 KiB (0.1%) fs: vfat
    dev: /dev/sda1 maj-min: 8:1
Swap:
  Kernel: swappiness: 15 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: file size: 6 GiB used: 0 KiB (0.0%) priority: -2 file: /swap/swap
Sensors:
  System Temperatures: cpu: 29.0 C mobo: N/A gpu: nouveau temp: 33.0 C
  Fan Speeds (RPM): N/A gpu: nouveau fan: 0
Repos:
  Packages: pm: dpkg pkgs: 2423 libs: 1331 tools: apt,apt-get,aptitude,nala pm: rpm pkgs: 0
    pm: flatpak pkgs: 0
  No active apt repos in: /etc/apt/sources.list
  Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list
    1: deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/debian.list
    1: deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
    2: deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/mx.list
    1: deb http://mirrors.rit.edu/mxlinux/mx-packages/mx/repo/ bookworm main non-free
    2: deb http://mirrors.rit.edu/mxlinux/mx-packages/mx/repo/ bookworm ahs
Info:
  Processes: 207 Uptime: 9m wakeups: 1 Memory: 31.27 GiB used: 1.22 GiB (3.9%) Init: SysVinit
  v: 3.06 runlevel: 5 default: graphical tool: systemctl Compilers: gcc: 12 Client: shell wrapper
  v: 5.2.15-release inxi: 3.3.26
Boot Mode: UEFI
Second, is the output of lsusb:

Code: Select all

wyckyd@ucs:~
$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 0d8c:0005 C-Media Electronics, Inc. Blue Snowball
Bus 001 Device 008: ID 6557:1631 Emtec USB DISK 3.0
Bus 001 Device 003: ID 0c49:636b Sonix Technology Co., Ltd. USB Camera
Bus 001 Device 002: ID 046d:0825 Logitech, Inc. Webcam C270
Bus 001 Device 007: ID 30fa:0400  USB OPTICAL MOUSE
Bus 001 Device 006: ID c0f4:07c0 USB usb keyboard
Bus 001 Device 005: ID 0bda:b812 Realtek Semiconductor Corp. RTL88x2bu [AC1200 Techkey]
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Last, is the output when I try to install the wifi driver:

Code: Select all

wyckyd@ucs:~/Downloads/88x2bu-20210702-main
$ sudo ./install-driver.sh
[sudo] password for wyckyd:
A required package is not installed.
Please install the following package: gcc
Once the package is installed, please run "sudo ./install-driver.sh"
Hope this helps. I still need to be able to install build-essential offline.

TIA,
WyCKyD
The thing with Linux is that the developers themselves are actually customers too: that has always been an important part of Linux. - Linus Torvalds

User avatar
operadude
Posts: 849
Joined: Tue Nov 05, 2019 12:08 am

Re: C++ compiler?

#14 Post by operadude »

Stevo wrote: Wed Nov 08, 2023 9:54 am build-essential will also install and configure essential tools, such as "make".

You don't need multilib packages unless you plan to cross-compile.
Great.

Thanks!

:cool:

User avatar
l0dr3
Posts: 463
Joined: Wed Jun 28, 2023 11:06 am

Re: C++ compiler?

#15 Post by l0dr3 »

WyCKyD wrote: Wed Nov 08, 2023 12:27 pm Here is some info about the computer that I am speaking about. Still not able to install the wifi driver because gcc isn't installed.
:
Hope this helps. I still need to be able to install build-essential offline.
Have a look at https://stackoverflow.com/questions/137 ... y/39968534 .

HTH, greetz l0dr3

User avatar
WyCKyD
Posts: 23
Joined: Sun Apr 14, 2019 2:20 am

Re: C++ compiler?

#16 Post by WyCKyD »

Have a look at https://stackoverflow.com/questions/137 ... y/39968534 .
I tried the steps that they outlined on the link, but still nothing.
Thank you for your input though. It is very much appreciated. I am willing to try almost anything to get this working right.
The thing with Linux is that the developers themselves are actually customers too: that has always been an important part of Linux. - Linus Torvalds

User avatar
kmathern
Developer
Posts: 2511
Joined: Wed Jul 12, 2006 2:26 pm

Re: C++ compiler?

#17 Post by kmathern »

These are links to the packages you would need to download to install build-essential:

Code: Select all

http://deb.debian.org/debian/pool/main/g/gcc-12/libstdc%2b%2b-12-dev_12.2.0-14_amd64.deb
http://deb.debian.org/debian/pool/main/g/gcc-12/g%2b%2b-12_12.2.0-14_amd64.deb
http://deb.debian.org/debian/pool/main/g/gcc-defaults/g%2b%2b_12.2.0-3_amd64.deb
http://deb.debian.org/debian/pool/main/b/build-essential/build-essential_12.9_amd64.deb

I got the links using apt-get's --print-uris option

Code: Select all

apt-get --print-uris install build-essential
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  g++ g++-12 libstdc++-12-dev
Suggested packages:
  g++-multilib g++-12-multilib gcc-12-doc libstdc++-12-doc
The following NEW packages will be installed:
  build-essential g++ g++-12 libstdc++-12-dev
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 12.7 MB of archives.
After this operation, 57.0 MB of additional disk space will be used.
'http://deb.debian.org/debian/pool/main/g/gcc-12/libstdc%2b%2b-12-dev_12.2.0-14_amd64.deb' libstdc++-12-dev_12.2.0-14_amd64.deb 2046372 MD5Sum:ebf5cd67cf8a1c4168144ad096723ed0
'http://deb.debian.org/debian/pool/main/g/gcc-12/g%2b%2b-12_12.2.0-14_amd64.deb' g++-12_12.2.0-14_amd64.deb 10694356 MD5Sum:c7ddaa4c1a2490b837c9ee95198bc9d7
'http://deb.debian.org/debian/pool/main/g/gcc-defaults/g%2b%2b_12.2.0-3_amd64.deb' g++_4%3a12.2.0-3_amd64.deb 1356 MD5Sum:ee1214564633e8a0ec102e218b4c66ca
'http://deb.debian.org/debian/pool/main/b/build-essential/build-essential_12.9_amd64.deb' build-essential_12.9_amd64.deb 7704 MD5Sum:4f52ee9542b58fce300ae068b634d281
You would download them and save all in the same folder. I think the Open With "Deb Installer" rightclick action will then install them for you if you right click on one of them.


edit: the links are only for MX23 (64bit) and may change in the future with package updates

edit 2: right click on the build-essential .deb file
Last edited by kmathern on Wed Nov 08, 2023 7:00 pm, edited 1 time in total.

User avatar
dolphin_oracle
Developer
Posts: 22069
Joined: Sun Dec 16, 2007 12:17 pm

Re: C++ compiler?

#18 Post by dolphin_oracle »

@kmathern the man the myth the legend!
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.

User avatar
WyCKyD
Posts: 23
Joined: Sun Apr 14, 2019 2:20 am

Re: C++ compiler?

#19 Post by WyCKyD »

Hello and thank you for responding. I downloaded the files that you mentioned, but when I go to install them, I get the following error:

Code: Select all

dpkg: dependency problems prevent configuration of build-essential:
 build-essential depends on gcc (>= 4:10.2); however:
  Package gcc is not installed.

dpkg: error processing package build-essential (--install):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of g++:
 g++ depends on gcc (= 4:12.2.0-3); however:
  Package gcc is not installed.

dpkg: error processing package g++ (--install):
 dependency problems - leaving unconfigured
Setting up libstdc++-12-dev:amd64 (12.2.0-14) ...
Setting up g++-12 (12.2.0-14) ...
Errors were encountered while processing:
 build-essential
 g++

I really would like to be able to install the drivers for my wifi adapter in MX 23.1 KDE AHS. I downloaded the MX 23.1 iso image and that is what I am using. I really like and enjoy MX! I have enjoyed MX linux since MX 18.

TIA
The thing with Linux is that the developers themselves are actually customers too: that has always been an important part of Linux. - Linus Torvalds

User avatar
WyCKyD
Posts: 23
Joined: Sun Apr 14, 2019 2:20 am

Re: C++ compiler?

#20 Post by WyCKyD »

I formatted and reinstalled MX 21.3 and then installed the wifi drivers without incident. I will try to upgrade to MX 23.1 later today.
It's a shame that the necessary files for compiling wifi drivers was left out of the MX 23.1 iso.
The thing with Linux is that the developers themselves are actually customers too: that has always been an important part of Linux. - Linus Torvalds

Post Reply

Return to “Software / Configuration”