Installing gcc-11 under JP 5.1

Hi,
I am currenty trying to compile a c++ console app which uses std::semaphore.
No the Problem occurs, that the maximum version of the gcc compiler for JP5 seems to be gcc10.
During me figuring out the problem i tried to compile this little file:

#include <iostream>

int main()
{
    std::cout << __cplusplus << "\n";
}

I compiled it with:

g++ -std=c++20 -o main main.cpp

But the maximum version of c++ i saw when running this was c++17. (201709)

Now I already figured out that you need at least gcc version 11 to use c++20 semaphore (please correct me if I’m wrong here), but there seems to be no possibility to install this version without building it yourself, which is something i currently can’t do due to other reasons.

So my question is, is there any case i can use the c++20 semaphore feature, either through an install of gcc11 which I missed or through another solution i don`t see.

Important to note: I cannot upgrade to JP6 due to other library restrictions i have.

Thanks in advance!

Hi,
The gcc version depends on Ubuntu version and Jetpack 5 is with Ubuntu 20.04. I tmay not be able to grade to later gcc release on 20.04. Would suggest upgrade to Jetpack 6 if you would like to have later gcc release.

Hi,
Thanks for your answer.
That means for me i have to go with the older conditionvariable/mutex approach until i am able to upgrade to JP 6.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.