tags:

views:

51

answers:

1

When I run the following command from a makefile on 64-bit Red Hat Enterprise Linux 5.0 using GCC 4.2.3:

gcc -c -ansi -pedantic -O0 -fPIC -I. -I.. -Iheader_files/include "source_file.c"

I get the following error:

cc1: error: unrecognized command line option "-lang-c"

Superficially, the problem is that "-lang-c" is no longer a valid option on newer versions of GCC. However, the deeper question is: Why does GCC receive a "-lang-c" option that wasn't in the original command?

Additional background:

  • The current installation doesn't have any GCC "specs" files that I can find
  • Running "gcc -dumpspecs" produces a long list of defaults, but "-lang-c" isn't among them.
  • "-lang-c" does not appear to be in any environment variables that I know of that influence GCC.

Any help would be appreciated.

Regards,

Mark Biesiada

+1  A: 

Make sure that your gcc driver program is the same version as your installed GCC.

Add the -v option to your compile command to check the versions and where the options are coming from.

mark4o
Also `locate gcc` and `locate cc1` will help you find other versions of the compiler that may be getting in the way.
bstpierre