LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   GCC errors with common flags aka -g, -ansi, -Wall (http://www.linuxquestions.org/questions/linux-software-2/gcc-errors-with-common-flags-aka-g-ansi-wall-786273/)

txjenniek 02-01-2010 03:02 PM

GCC errors with common flags aka -g, -ansi, -Wall
 
I have the latest GCC + Build Essentials package installed, and verified that gcc -v does output. Also, I have done essentially the same installation on two computers. On one, gcc works fine. On the other, any flags added to gcc command is producing errors:

Useless example w/ no reported errors: gcc test.c

gcc test.c -g -Wall -o test
-g: No file or directory found
-Wall: No file or directory found
(etc.)

I've tried several things and searched the forums and can't seem to find something specific to this error. Thanks.

PS, I'm sure that my simple hello world program is only C code and compilable since it operates fine on the other machine.

CoderMan 02-01-2010 05:02 PM

Quote:

Originally Posted by txjenniek (Post 3848734)
I have the latest GCC + Build Essentials package installed, and verified that gcc -v does output. Also, I have done essentially the same installation on two computers. On one, gcc works fine. On the other, any flags added to gcc command is producing errors:

Useless example w/ no reported errors: gcc test.c

gcc test.c -g -Wall -o test
-g: No file or directory found
-Wall: No file or directory found
(etc.)

I've tried several things and searched the forums and can't seem to find something specific to this error. Thanks.

PS, I'm sure that my simple hello world program is only C code and compilable since it operates fine on the other machine.

That's weird. I always thought it didn't matter whether the options came before or after the infiles. Can you put test.c at the end of the command, and see if that works?

BTW: What kind of system are you on? (Linux distro version?) What version of gcc is it?

David1357 02-01-2010 05:30 PM

Quote:

Originally Posted by txjenniek (Post 3848734)
gcc test.c -g -Wall -o test
-g: No file or directory found
-Wall: No file or directory found

What is the output of "ls -al $(which -a gcc)" on the system that reports these errors?


All times are GMT -5. The time now is 09:11 AM.