you know, software not wanting to compile is way, way far away from what you would hate on linux as a regular user, it's mostly app accessibility. Arguably, I'd say it's lots easier to compile linux apps from source than, say, windows, exactly because linux has been designed to allow you to do stuff to the computer that windows would frown upon, plus you have stuff like gnu autotools, cmake and all that good stuff. If c++ doesn't install, dk, did you try to google the error you're getting?
anyway, here's a command you could try
sudo apt install build-essential
even though you should have this package, it's weird that you don't honestly.
to check that the package works, type this
g++ --version
now, to compile an actual c++ program, type this in a file called cpp_test
#include<iostream>
#include<cmath>
#include<stdlib.h>
using namespace std;
//a point struct, to make this puny program more interesting because I'm bored
struct point{
float x;
float y;
};
int main() {
//typing it this way in order for it to be longer.
point p1;
p1.x=30;
p1.y=0;
point p2;
p2.x=0;
p2.y=30;//can you think from your mind what's the distance gonna be?
auto distance=sqrt((pow(abs(p2.x-p1.x), 2)+pow(abs(p2.y-p1.y), 2)));//hope I got the math right
//the grand print
cout<<"the distance between "<<"("<<p1.x<<", "<<p1.y<<")"<<" and "<<"("<<p2.x<<", "<<p2.y<<") "<<"is: "<<floor(distance);//I know I could perhaps write it better, but meh
return EXIT_SUCCESS;
}
you compile it with this command, assuming you are in the same directory the cpp file is
g++ -o test cpp_test.cpp
then, if you didn't get any errors which is highly unlikely since I just wrote this in here, no compile step done before, type this to run your c++ program
./test
it should print...what? what does it print indeed? left as an exercise to the reader.
so yeah, way easier than typing hell knows how many msvc specific commands with very long and weird arguments just to compile a simple project, right? Luckily, gcc and g++ are also for windows, plus we have clang over there as well, just so you know, but that's neither here nor there. Thing is, it's way easier to build software for linux than anything else imho, that's not its weakness, it's one of its strong points actually.