April 8th, 2003, 05:30 PM
compiler error problem
with my IDE (quincy 99), i try compiling even a simple script, but it always comes up with this error msg:
gcc.exe: cannot specify -o with -c or -S and multiple compilations
what does that mean, and how can I fix it?
April 8th, 2003, 08:58 PM
The -c option compiles the source file and stops -- ie, it does not link the resultant object file into an executable.
The -S option produces an assembly code output and stops -- ie, it does not create an object file nor does it create an executable.
In both these cases, the resultant .o or .s file would by default have the same name as the source file -- eg, gcc -c foo.c would produce a foo.o file. The -o option allows you to rename the output file -- gcc -o bar.s foo.c -S would produce a bar.s file.
Obviously, you can only rename the output file of a single source file. So if you run gcc on multiple source files, you cannot change the output names from the default because there's no way to specify the new name for each and every one of the multiple source files. You'd have the ridiculous situation of trying to give the same name to multiple output files in the same directory.
Thanks for the question. I had never thought of trying to use the -o option with the -c and -S options, nor that it could create problems.
Oh, sorry, I forgot. You fix it by either not using the -o option in those cases, thus allowing the output files to receive their default names, or by only compiling single source files when you do want to change the name of the output files with -o .
Last edited by dwise1_aol; April 8th, 2003 at 09:04 PM.
April 9th, 2003, 03:31 PM
how exactly would I change it?
April 9th, 2003, 09:42 PM
Well, what are you trying to do?
If you're compiling multiple source files to produce object files or assembly source, then don't use the -o option. Just let the output files default to the source-file names.
If you really want to use the -o option, then compile only one source file at a time.
If it's your IDE that's trying to do this on its own initiative, then check its settings and/or the make file to see what might be causing those options to be set.
Sorry to say, but if the problem is Quincy-specific, you will probably need to find another Quincy user or whoever developed it. But still, check the IDE options and configuration to see if anything I mentioned has been selected.
Last edited by dwise1_aol; April 9th, 2003 at 09:47 PM.