I just installed Elementary OS to program mainly because of its editor simplicity. However I don't know how to transform it into an IDE for C++.
You can try this: https://quickfever.com/how-to-setup-c-plus-plus-development-environment-in-linux/. Elementary OS is a derivative of Ubuntu so you may have success with this method.
I think you need to compile via CLI (Terminal), or use an IDE that's integrated with C++. https://stackoverflow.com/questions/24109/c-ide-for-linux