Where to download GNU C++ compiler - Stack Overflow
How to download GNU complier for c++
How do I get a GCC?
I can't install the GCC compiler recommended by Bro Code
Videos
Factsheet
Getting everything you need on Debian/Ubuntu is very easy:
sudo apt-get install build-essential
What about using GCC ?
Quoting it's homepage :
The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, and Ada, as well as libraries for these languages (libstdc++, libgcj,...).
It will definitly work on Ubuntu ; it's even provided through the package system (sorry, my system is in french) :
$ apt-cache show g++
Package: g++
...
Description-fr: Compilateur C++ du projet GNU
Le compilateur C++ du projet GNU. Un compilateur C++ relativement portable
et capable de bonnes optimisations.
(which translates to Description: The GNU C++ compiler. This is the GNU C++ compiler, a fairly portable optimizing compiler for C++. in English)
For informations about Windows support, you can have a look at : http://gcc.gnu.org/install/specific.html#windows
Something like MinGW or Cygwin will probably do :-)
Quoting MinGW's homepage :
MinGW, a contraction of "Minimalist GNU for Windows", is a port of the GNU Compiler Collection (GCC), and GNU Binutils, for use in the development of native Microsoft Windows applications.
For netbeans, I can't tell : I don't use it -- not for C++, at least...
The actual website for GNU is super confusing, and doesn't let you download it from the internet directly. I'm using mac by the way.
I recently started learning and then I realized I needed a GCC so my C code can run but I am having a lot of problems trying to download it
I took an update today on my Ubuntu 22.04 and encountered the error with VMware Workstation 16 Pro 16.2.4 build-20089737 shown in the question here.
GNU C Compiler (gcc) version 12.3.0, was not found. If you installed it in a non-default path you can specify the path below. Otherwise refer to your distribution's documentation for installation instructors and click Refresh to search again in default locations.
I've used VMWare every day since this OS was fresh installed in 2022.
There were three problems to fix:
Missing gcc 12
My gcc --version is 11.4.0. I checked ls /usr/bin/x86_64-linux-gnu-* and version 12 was not there.
$ sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa -y
$ sudo apt update
$ sudo apt install g++-12 gcc-12
Then try again.
skb_gso_segment undefined
The build breaks because of gcc header changes. The VMWare build provides a log file like /tmp/vmware-user/vmware_1234.log that shows the compiler error.
This particular function, skb_gso_segment, has moved to a new header that VMWare bridge.c does not #include.
To see for yourself the header where this function is defined, cd /usr/src/linux-hwe-6.5-headers-6.5.0-14/include/net and grep skb_gso_segment *.
To fix VMWare code:
$ sudo su
$ cd /usr/lib/vmware/modules/source
# back up original tar file
$ cp vmnet.tar vmnet.tar.original
# change the code
$ tar -xvf vmnet.tar
$ nano vmnet-only/bridge.c
After the #include <linux/netdevice.h>, add
#include <net/gso.h>
Save and exit. Then rebuild the tar file.
$ tar -cf vmnet.tar vmnet-only
$ exit
Then try again.
__pte_offset_map undefined
Next the build fails because a function has changed names. In VMWare Workstation 17, the code in pgtbl.h was changed like this by VMWare:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,5,0)
pte_t *pte = pte_offset_kernel(pmd, addr);
#else
pte_t *pte = pte_offset_map(pmd, addr);
#endif
To fix v16, I made a similar change.
$ sudo su
$ cd /usr/lib/vmware/modules/source
# back up original tar file
$ cp vmmon.tar vmmon.tar.original
# change the code
$ tar -xvf vmmon.tar
$ nano vmmon-only/include/pgtbl.h
In the editor, search down to pte_offset_map and change it to pte_offset_kernel.
Save and exit. Then rebuild the tar file.
$ tar -cf vmmon.tar vmmon-only
$ exit
Then try again.
This got me back in operation.
I too had this issue and what resolved it for me was as simple as
sudo apt install gcc-12 libgcc-12-dev