Menu

windows.h is declared twice :\

2002-11-29
2012-09-26
  • Nobody/Anonymous

    My app consists of this 6 files:
    main.c - All necessary .hs are #included in it.
    main.h - All global vars, HINSTANCES, HWNDS, etc. No #includes.
    ini_io.h - ini_io functions and no #includes.
    setcontrols.h - Some setfont stuff, no #includes.
    resources.h - For the Ids, no #includes.
    dialogs.rc - Off course, "resources.h" is included here. But i also HAVE to #include windows.h or else i cant compile my app. Once i #include it, everything runs smooth.

    Ok, now tell me: Why the hell i got no problems having no #includes at ini_io.h for example (which uses windows.h, stdlib.h, stdio.h functions) and i have at dialogs.rc?
    And what to do? windows.h is declared at two files (main.c and dialogs.rc)! Is it normal?

     
    • Nobody/Anonymous

      You should use #ifdef and #ifinclude

       
    • Nobody/Anonymous

      I also use the same includes in several files on big projects.  I myself constider this normal.  I do try to code in such a way to avoid having to do this, but what works, works, so I will not complain.  Wayne, having a better understanding of C++ standards, will be able to answer your question form the compiliers point of view.  But like I said, I do it, it works, so I consider it very normal.

      Curtis

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.