Menu

Global Defines and Dev-C++ indentifyer define

2005-04-29
2012-09-26
  • rpg_code_master

    rpg_code_master - 2005-04-29

    How do you globally define something witthout including any .H files etc...

    ie. In Visual Studio you would place the defines in the project options.

    Visual Studio has _MSC_VER, what the Dev-C++ equivilent?

     
    • Nobody/Anonymous

      Put -D in the compiler options. For example -DOPTION2 will globally define OPTION2.

      I don't remember how to get the version number. Mabye someone else can tell you.

       
      • Nobody/Anonymous

        Where do I set the default compiler options? I would like to undefine WIN32

         
        • cpns

          cpns - 2008-01-29

          Why!? Some headers test that macro to determine the platform and include target compatable code. It would be a really dumb idea. If you don't want _WIN32 to be defined, use Linux! ;-)

          You use -U<macro> to undefine a macro from the command line, ( http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Preprocessor-Options.html#Preprocessor-Options ). It will have no affect on a macro subsequently defined in the source being compiled, and only works for built-ins and previous -D defined macros.

          With respect to where to set default compiler options, it may be just me, but Dev-C++ is not a big application, and it is fairly intuitive, you might just explore the dialogs and learn something! Not doing so suggests an extraordinary lack of curiosity. There is one thing you should understand however; settings can be set for a project or globally. I recommend experimenting with ill-advised settings within a project - if you screw up the global settings it will be inherited by all projects created thereafter (and some settings are applied to existing projects rather than just new ones, so you could prevent your previous work from building correctly). For projects: Project->Project Options->Paremeters, or globally Tools->Compiler options->General.

          With respect to compiler/target identification macros this site lists macros used by a number of compilers: http://predef.sourceforge.net/index.php

          Clifford

           
    • Nobody/Anonymous

      If _MSC_VER is the version number, VERSION and GNUC_MINOR

      http://www.astro.uni-bonn.de/~webstw/cm/gnu/gcc/cpp_13.html

       

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.