One of misuse stm32 keil compiler #define of

Platform: LPC40XX.

keil4 in. One #define error 

The main function is defined in a header file main.h using (main.h not defined in the file main.c) In main.c test.c used in another file (not shown in main.h test. c defined in the file).

E.g:

 

#ifndef  __MAIN_H

#define __MAIN_H

#define  TEST   1

 

#endif

 

============================ These are main.h file =============== =

E.g:

#if  TEST 

  a= a+1;

#else

  a=a-1 ;

#endif

===================================================

In this process, keil4 the compiler will not complain. In my TEST compiler will default to 0;

 

Guess you like

Origin www.cnblogs.com/xiongF/p/12072361.html