Home/Support/Support Forum/What is the purpose of the preprocessor directive #error?
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

What is the purpose of the preprocessor directive #error?

0 votes
purpose of the preprocessor directive #error?
asked Dec 17, 2014 in Android by venki New to the Community (0 points)

Please log in or register to answer this question.

3 Answers

+1 vote
per https://stackoverflow.com/questions/5323349/error-directive-in-c:

It's a preprocessor directive that is used (for example) when you expect one of several possible -D symbols to be defined, but none is.

#if defined(BUILD_TYPE_NORMAL)
# define DEBUG(x) do {;} while (0) /* paranoid-style null code */
#elif defined(BUILD_TYPE_DEBUG)
# define DEBUG(x) _debug_trace x /* e.g. DEBUG((_debug_trace args)) */
#else
# error "Please specify build type in the Makefile"
#endif
When the preprocessor hits the #error directive, it will report the string as an error message and halt compilation; what exactly the error message looks like depends on the compiler.
answered Jan 27, 2015 by LeonidM Veteran of the Digi Community (3,556 points)
0 votes
Havent any solution of your problem.
answered Jan 28, 2015 by williamjames07 New to the Community (7 points)
0 votes
answered Jan 29, 2015 by challpagal New to the Community (1 point)
edited Feb 15, 2015 by challpagal
...