Trouble with compiling / using #include <iostream> / Mac

Hi there -

I’m using a mac and having some trouble using VS Code - im getting an error when i try and compile my Hello World test (see attached images)

i have Xcode, etc - and i tested “g++” in my computer terminal and it shows it’s all installed…

Any idea why this might be happening? Could use some help - its keeping me from getting into the course and i’m eager to get moving!

Thanks for any help!
Carter

The directory you are in in the terminal is not the same as the one where you saved TripleX.cpp

The terminal shows you are in ~/ which is your home directory and you saved your file in ~/Desktop/Triple X so you need to cd into that, alternatively you can right click the file in the explorer view and open a terminal from the menu.

As for the include path, first open the folder in VS Code (will also mean terminals will open here) via File > Open Folder.
Then Command + Shift + P > Edit Configuations (UI)
and use the drop down menu to select g++

e.g. with Windows and MSVC

Awesome - thanks so much!

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

Privacy & Terms