Score:0

How do I make g++ 10 my default c++ compiler

cn flag

I am using 20.04 and I have g++ 10 installed, but when I use g++ --version it says 9.3. Also, I can't use any c++ 20 in my code in either IDE I use. Please let me know how I make g++ 10 the default. Thanks

galexite avatar
pk flag
Did you know you can set the `CXX` environment variable, and most build systems will inherit that configuration? If you're using a build system generator, like CMake, you'll need to export this in your environment when you run configuration.
galexite avatar
pk flag
What IDE do you use?
cn flag
I use both CLion and Code::Blocks
cn flag
I think i just need to know how to set the CXX environment variable then.
cn flag
Well, I solved the problem in a roundabout way, I upgraded to 21.04 and it set my default g++ to 10
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.