×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    6

    Problem of NULL redefinition.

    I'm facing the problem of NULL being defined twice. The scenario arises when part of the project is in C code. Consequently, I have to include stdio.h in my file. Obviously, NULL is defined in this file. Now, this NULL is also defined in e32std.h and that too without an #ifndef.
    Hence, a build would result in a clashing of definitions of NULL. I think life would have been much easier had e32std.h contained a #ifndef to check if NULL has already been defined.

    Regards
    Shankar

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    101
    I have encountered the same problem. It is also pretty hard to handle in your own code as you need to add #undef to multiple locations.

    (also macro definitions TRUE and FALSE sometimes give me a headache)

    In my projects I have edited e32std.h and added #ifndef-safeguards for those macro-definitions.

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    8

    You can actually fix the problem

    I had this problem as well. If I remember correctly, it occurs when C standard library header files are included before e32std.h (I think). If you switch the order of your includes, it should work out.

    Ben

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×