error: ‘NULL’ was not declared in this scope

后端 未结 6 2038
暗喜
暗喜 2020-12-04 09:42

I get this message when compiling C++ on gcc 4.3

error: ‘NULL’ was not declared in this scope

It appears and disappears and I don\'t know w

6条回答
  •  孤城傲影
    2020-12-04 10:41

    You can declare the macro NULL. Add that after your #includes:

    #define NULL 0
    

    or

    #ifndef NULL
    #define NULL 0
    #endif
    

    No ";" at the end of the instructions...

提交回复
热议问题