Also found in: Dictionary, Legal.
compiler directiveA statement written in the source code of a program that does not become a command in the running of the program for the user. The compiler directive lets the programmer instruct the compiler to perform a specific operation within the compilation phase such as using alternate syntax for a source code statement.
A compiler directive is often required when the same source code is compiled on two different hardware platforms such as Windows and Linux. For example, the code might be compiled and tested on Windows but compiled and run on Linux. A few statements in the code may require different syntax, and the compiler directive accomplishes this, essentially stating "use this line of code rather than that one." See pragma and compiler.