user100663 user100663 - 27 days ago 9
C Question

gcc no such file or directory error

I am trying to compile a C program and am required to use these flags. I was hoping you could tell me why I am getting these errors.

Command:

gcc -ansi –Wall –pedantic stack.c


Output:

gcc: –Wall: No such file or directory

gcc: –pedantic: No such file or directory

Answer

It's

gcc -ansi -Wall -pedantic

You're using one of those dashes: Dash (specifically, you are using en-dash U+2013). You need to use minus sign - instead