Search code examples
gccg++cygwin

#ifdef works, #ifndef gives error?


Using gcc and g++ version 4.5.3 with cygwin, I made this program and found that #ifndef doesn't seem to work right.

#ifndef BLAH
#define <stdio.h>
#endif
int main(){
 return 0;
}

Using #ifdef seems to work fine though. The error I'm getting is "macro names must be identifiers".

Does #ifndef require something specific?


Solution

  • #define <stdio.h>
    /*  ^
         \
          --- this should be #include
    */
    

    Example