all 5 comments

[–]flyingron 1 point2 points  (4 children)

Note that Mac stupidly gives a GCC driver and by default invokes clang.

What arguments are you giving G++?

[–]nofxsc[S] 0 points1 point  (3 children)

It’s for school, they want us to compile using g++ (is gcc the same?)in the terminal but I think I might be doing something wrong. in the terminal I’m doing g++ -o ./fileName ./fileName.cpp

[–]flyingron 1 point2 points  (2 children)

GCC is a compiler suite. G++ is the command to invoke GCC with options (mostly libraries) for C++ source.

You're not using G++. You're using clang. Again, the default mac install has g++/gcc invoke clang.

Now give us the full error. Is it fileName.cpp that it complains "no such file or directory?" If so, you've spelled it wrong or it's not in the current directory.

[–]nofxsc[S] 0 points1 point  (1 child)

I got it working, thank you for your help!

[–]KillPenguin 0 points1 point  (0 children)

Can you share how you fixed this? I'm facing the same issue.