Struggling to Install C++ Latest Version – Help Needed!

0
2
Asked By CuriousCoder88 On

I've been trying to update to the latest C++ standard for Visual Studio Code by installing MinGW64 through MSYS2, but I'm having a really tough time. A simple program that checks the C++ version says I'm on 202302 (C++23), but when I try to run some C++23 features, it throws errors instead. I've updated everything in MSYS2, moved "C:/msys64/mingw64/bin/" to the top of my PATH, and even removed the paths to older versions of MinGW. When I check my paths through the 'where' command, they all point to MinGW64 (c:msys64mingw64bin). I'm on Windows 10. Here's the error I'm getting:

`g++ hello23.cpp -o hello23 -std=c++23` produces some undefined reference errors related to terminal functions. My code is just:

```
#include
#include

int main() {
std::print("Hello worldn");
std::println("Hello againn");
std::puts("Hello once more");
return 0;
}
```

Any help would be greatly appreciated!

1 Answer

Answered By CodeWizard42 On

If you're just starting out, I suggest focusing on coding instead of wrestling with your development setup. Using an integrated development environment (IDE) might save you a lot of headaches. Microsoft has a pretty solid IDE that’s similar to Visual Studio Code; try using Visual Studio Community. It’s tailored for these kinds of tasks and should be easier to manage than fiddling with VS Code.

CuriousCoder88 -

I appreciate the suggestion! I really do like Visual Studio for its user-friendly setup, but for learning, I prefer writing small one-file programs in VS Code. It’s just really frustrating getting everything set up correctly.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.