I think there may be something wrong with my gcc and g++ install because this code below will not run on my computer.
#include <iostream>
#include <numbers>
int main()
{
long double pi {0};
long double pi2 {0};
pi = std::numbers::pi_v<long double>;
pi2 = std::numbers::pi_v<long double>;
std::cout << pi << std::endl << pi2;
}
How can I do a full reinstall on gcc and g++? Also, how do I make sure CodeBlocks is using this reinstalled version.
EDIT:
running g++ version 11.1.0 & using the -std=c++20 this is the error message that appears:
g++ randomCodeWhileReading.cpp -o -std=c++20
randomCodeWhileReading.cpp: In function ‘int main()’:
randomCodeWhileReading.cpp:9:16: error: ‘std::numbers’ has not been declared
9 | pi = std::numbers::pi_v<long double>;
| ^~~~~~~
randomCodeWhileReading.cpp:9:30: error: expected primary-expression before ‘long’
9 | pi = std::numbers::pi_v<long double>;
| ^~~~
randomCodeWhileReading.cpp:10:16: error: ‘std::numbers’ has not been declared
10 | pi2 = std::numbers::pi_v<long double>;
| ^~~~~~~
randomCodeWhileReading.cpp:10:30: error: expected primary-expression before ‘long’
10 | pi2 = std::numbers::pi_v<long double>;
| ^~~~
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…