compilation fatal error header file g++

2019-06-22 13:17发布

问题:

I'm getting this compilation error:

fatal error: can’t create precompiled header f: Text file busy
compilation terminated.  

This is a very mysterious one, since i get it only once in a while..

Where do i go wrong?

回答1:

ETXTBSY is a standard errno value, the best explanation I've found being:

An attempt to execute a file that is currently open for writing, or write to a file that is currently being executed. Often using a debugger to run a program is considered having it open for writing and will cause this error. (The name stands for "text file busy".)

So, you might still be executing the program the compiler is trying to recreate/update...?