RE: Why [cannot specify -o option with -c or -S]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Most of the time that I've seen this error, it was because of a macro
that had quotes in it that wasn't specified properly on the command line
(or, rather, in the Makefile).  For example, I've seen stuff like this
in Makefiles:

-DMYMACRO=\"my macro text\"

The intention is to replace MYMACRO with the string '"my macro text"'.
But what will happen with that is that the shell will interpret that as
three separate arguments to GCC ('-DMYMACRO=\"my', 'macro' and
'text\"'), and GCC will think that 'macro' and 'text\"' are separate
options to the compiler and get confused.  Depending on the text, you
could easily confuse it to the point that you get the error you've seen.
For example, it may be thinking that 'macro' and 'text\"' are source
files to be compiled, in which case, it would be invalid to mix -c and
-o, because it would be invalid to specify a single output file for more
than one source file.  The solution in a case like this is to fix the
macro:

-DMYMACRO="\"my macro text\""

I don't know that that's what your problem is here, but it's something
to look at, when you're searching for the culprit.  An easy way to tell
would be to simply paste the actual command line being executed to the
list.  We could then look at it and tell you what's wrong with it.  You
can then trace that back to the appropriate thing to fix in the
Makefile.

Cheers,
Lyle

-----Original Message-----
From: Raghu Ram Murthy [mailto:me_rams@xxxxxxxxx] 
Sent: Monday, October 27, 2003 11:24 AM
To: gcc-help@xxxxxxxxxxx
Subject: Why [cannot specify -o option with -c or -S]

Hello all,
Why we can't specify -o option with -c or -S option. I
saw in some Makefiles those are generated by configure
script, containing both options. And while I am
running make it is giving this error.

Please help mw how to rectify the error without
changing Makefile, because there are more than 100
makefiles. I am ready to change the configure script. 
Please specify where to change.

Regards


=====
-----------------------------------------
P.Raghu Ram Murthy, M-tech (Computer Science),
Room No - 245,
Brahmaputra Hostel,
Indian Institute of Technology Madras,
Chennai - 36.
------------------------------------------ 




__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux