Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] MBS: Linker step should not run if the flag "Preprocess only (-E)" is specified in the compile step

Hi,

While compiling my main.c file, I can specify the flag -E (Preprocess only) in the project properties dialog (C/C++ Build -> GCC Compiler -> Preprocessor -> Select the checkbox "Preprocess only").
If this flag is specified, the file which is generated as a result of the compile step will have the name main.o, but will contain a pre-processed c file.

The linker invocation fails because the file main.o is not a valid object file.
Is it possible to cancel the invocation of a future command by checking the value of an option specified for an earlier command?

The console output is:

-----------------------------------------------------------------------------------------
**** Build of configuration Debug for project hello ****

make -k all
Building file: ../main.c
Invoking: GCC C Compiler
gcc -E -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o"main.o" "../main.c"
Finished building: ../main.c

Building target: hello.exe
Invoking: GCC C Linker
gcc  -o"hello.exe"  ./main.o  ./main.o: file not recognized: File format not recognized
collect2: ld returned 1 exit status
make: *** [hello.exe] Error 1
make: Target `all' not remade because of errors.
Build complete for project hello
-----------------------------------------------------------------------------------------

Thanks
Abeer

Back to the top