cgcccaching

gcc and caching


I'm developing a C program and oddly as I update the source files I don't see any change in the resulting executable. Is it possible gcc stores a cached copy of the files and even if I compile I don't get the newer version of my executable? In this case how can I force the compiler to use the newly edited files?

I am compiling my code with the following:

# gcc -o myExecFileName source_file_1.c source_file2.c

Solution

  • To answer your question, no gcc will not cache your files. Something else is going on. You are either changing files in a different directory as @Lee D suggests, or you are not saving the files before compiling, or perhaps the changes you are making are ifdef'd out.