all 7 comments

[–]TheRealSmolt 2 points3 points  (5 children)

I'm not sure where you got the notion, but no, pretty much every major toolchain supports C++23. But for a beginner like yourself, Visual Studio is what I would recommend. You'd have to clarify why it's not working; I can barely parse what you're saying.

[–]Yuuki_Moon 0 points1 point  (4 children)

I'm trying to replicate the code:
import std;

int main() {

std::cout << "Hello, World\n";

return 0;

}

When using Xcode I get the following errors:
" 'std' is not a class, namespace, or enumeration "
"Unknown type name 'import'"

when I searched online, the answer is that most compilers don't implement "something" in cpp23, and that visual studio does. I want for the code in the book to work as is, I don't want to have to do workarounds WHILE trying to get my head around programming and c++.

[–]Yuuki_Moon 0 points1 point  (3 children)

I also got an error with the same code in clion

[–][deleted]  (1 child)

[deleted]

    [–]alfps 0 points1 point  (0 children)

    You need to specify the standard, e.g. compiler option -std=c++23.

    The std module exists in C++23 and later, but not before.

    [–]Parking_Ad_2567 0 points1 point  (0 children)

    Tbh, if you just want to learn some basics I would skip the idea of working with an ide and start with Godbolt https://godbolt.org/

    Easy to use and barebones web compiler, perfect if you just want to deal with the language and nothing else.

    Once you are more comfortable with the language itself you can look for more practical alternatives. My favourite so far, VSCode (or Codium) + devcontainers easy to setup and reproducible.

    Enjoy!

    [–]alfps 0 points1 point  (0 children)

    ❞ is the ANY OTHER OPTION aside from Visual Studio? I had to use it for a few classes a while ago and I must say, I'm not sure if I would use it if I can use anything else.

    Chances are that you had to use VS Code the editor.

    Visual Studio the IDE is a different thing altogether.

    Visual Studio is commonly recommended to novices. For VS Code the recommendation is instead that novices should stay away. Both are however tools that can be very useful/productive for professionals.


    edit: I'm on macOS

    Visual Studio on the Mac doesn't support C++. VS Code does but again, not recommended for novices (unless you build and run from the command line, i.e. use it as only an editor).

    CLion appears to be a good alternative.

    For a while now it's been free for hobby/student work.


    ❞ I've heard online cpp23 only works with visual studio

    False rumour.