Question

Programming newbie, I want to disable the compiler/linker and just look at the precompile/ preprocessor's preprocessed code for a program...not sure what this would be called or what the usual method is for doing something like this.

Using the GNU GCC compiler in Code::Blocks, and I looked thru all the various options but not sure the command or what the menu item is called/labeled.

Was it helpful?

Solution 2

You can use the following option to see the pre-processing files. Normally the compiler will create the files on the fly while trying to create an object file. But at the end removes them.

So in order to view them you can use the command with save-temps.

The output will have the following files:

  1. hello.i-Pre-Processed Output
  2. hello.s-Assembler Output
  3. hello.o-Compiler Output

gcc -save-temps hello.c

OTHER TIPS

gcc -E source.c -o myfile.i

Here -E is a flag stand's for PRE-Process only.

And -o is another flag which stores the PRE-Processed output of source.c into myfile.i (here .i is common extension given for PRE-Processed files in gcc)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top