Does an error stop making a program?

35 Views Asked by At

For example, if I incorrectly #include something and the preprocessor gets an error, does it still go through the compiler, assembler, and linker?

1

There are 1 best solutions below

1
On

Make a small program which contains only this line:

     #includerr (stdio.h) 

And tell me what happens...

Can you see any .OBJ, or .O , or .EXE or a.out files? If you can see .O or .OBJ, the file has been compiled and assembled. If you see any .EXE or a.out files, the file has been linked to the standard libraries and produced an executable.


If you cannot see any of these files, manually try to compile the file. For example, under Linux you can do:

gcc -c -S file.c

Will compile and produce an assembly file, then will stop. If you can see the .S file after this, and the file is not empty, file.c has been succesfully compiled and translated into assembler.

If you do:

gcc -c file.c

Will try to compile and assemble file.c resulting in file.o if it successes.

If you do:

gcc file.c

Will try to compile, assemble, and link file.c resulting in a.out if it successes.