问题
In my code I am using the #error
preprocessor directive in order to create an error. However, it still continues the building process.
How can I force the building process programmatically to stop after encountering my error?
I am using Microsoft Visual Studio 2015, C++ v140, x86, for Windows 10.
回答1:
From MSDN
The #error directive emits a user-specified error message at compile time and then terminates the compilation.
(Emphasis Added)
If compilation is continuing after the #error
directive, then you're doing something odd, or MSVC is broken.
来源:https://stackoverflow.com/questions/33263158/how-can-i-programmatically-force-the-compiler-to-stop-the-compilation-process-af