There are several steps involved from the stage of writing a C program to the stage of getting it executed. when I compile the code I only get an .exe file. But I want to get all the files which are being made before the compilation (preprocess ones), an intermediate code file where all those macros with are replaced with their actual values and preprocessor are replaced with their actual header files. in general can we get all those files (preprocess one, compile one and linker one) separately?
Asked
Active
Viewed 352 times
1 Answers
1
To access all the intermediate files use the command (Ubuntu):
gcc –Wall –save-temps filename.c –o filename
. This command generates all the intermediate files in current working directory.

Krishna Kanth Yenumula
- 2,533
- 2
- 14
- 26
-
-
-
Open command line in Windows. Change directory to the file directory. Then type that command. That's it. – Krishna Kanth Yenumula Nov 24 '20 at 17:10
-
Learn how to use command line in Windows. I am not sure, if this command works on Windows OS. It works on Ubuntu OS. – Krishna Kanth Yenumula Nov 24 '20 at 17:11
-
-
there is no other way to get this file ,without using any command line – jonesalex Nov 24 '20 at 17:13
-
Did you change the directory?? Did you change the filename ? – Krishna Kanth Yenumula Nov 24 '20 at 17:14
-
-
-
It should work on Windows using [MinGW](http://www.mingw.org/), is a port of `gcc` – David Ranieri Nov 24 '20 at 17:19
-
@DavidRanieri can you explain that command because i know very less about cmd – jonesalex Nov 24 '20 at 17:22
-
Basically instead of using your RAD to compile, you launch the compiler from a console, for short programs it can be compiled using `gcc` directly, for larger ones we use a `Makefile` containing the rules, I suggest you to check how to send parameters to the compiler from your RAD, i.e. `Options\Build\gcc` on QTCreator and add this `-save-temps` to the toolchain. – David Ranieri Nov 24 '20 at 17:29