C++ Compiler for windows?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rufus

    C++ Compiler for windows?

    Is there a C++ compiler for windows that can be run from the commmandline? I
    have only be able to find MS Visual Studio but its rather overkill since I
    also like to just use notepad for my code.


  • Leclerc

    #2
    Re: C++ Compiler for windows?

    rufus wrote:
    Is there a C++ compiler for windows that can be run from the commmandline? I
    have only be able to find MS Visual Studio but its rather overkill since I
    also like to just use notepad for my code.
    >
    >
    Well,
    all of them can be run from command line.

    For MS VC, you need to start "Visual Studio 20XX Command prompt" and
    after that issue CL command. Alternative would be to start cmd.exe, and
    after that execute vcvars32.bat, located in BIN directory of VC
    distribution.


    Comment

    • James Kanze

      #3
      Re: C++ Compiler for windows?

      On Jul 13, 9:55 am, "rufus" <as...@asd.comw rote:
      Is there a C++ compiler for windows that can be run from the commmandline? I
      have only be able to find MS Visual Studio but its rather overkill sinceI
      also like to just use notepad for my code.
      VC++ works fine from the command line. As far as I know, in
      fact, it can only be invoked from the command line---Visual
      Studios generates a command line to invoke it.

      If you've installed Visual C++ correctly, there should be an
      entry in your program menus for "Visual Studio 2008 Command
      Prompt", or something similar. This will start a console window
      with the environment all set up. If you want to use a different
      shell (highly recommended), then you'll have to copy the
      necessary components of the path into your system path (or the
      path of your shell), and define the environment variables LIB
      and INCLUDE with the values they have in this window. (I've
      used VC++ from the command line in MSys, CygWin and UWin; I
      usually invoke it from a gmake file, however, which also works
      fine under Windows. If you do use some of the Unix tool set,
      however, you might want to consider moving things around so that
      there are no spaces in any of the path names---you can make it
      work with spaces, but it's a lot more difficult.)

      The actual command is cl. Note that like most other compilers,
      you'll need a lot of options for it to be really usable.

      --
      James Kanze (GABI Software) email:james.kan ze@gmail.com
      Conseils en informatique orientée objet/
      Beratung in objektorientier ter Datenverarbeitu ng
      9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

      Comment

      • want.to.be.professer

        #4
        Re: C++ Compiler for windows?

        On 7月13日, 下午5时04分 , James Kanze <james.ka...@gm ail.comwrote:
        On Jul 13, 9:55 am, "rufus" <as...@asd.comw rote:
        >
        Is there a C++ compiler for windows that can be run from the commmandline? I
        have only be able to find  MS Visual Studio but its rather overkill since I
        also like to just use notepad for my code.
        >
        VC++ works fine from the command line.  As far as I know, in
        fact, it can only be invoked from the command line---Visual
        Studios generates a command line to invoke it.
        >
        If you've installed Visual C++ correctly, there should be an
        entry in your program menus for "Visual Studio 2008 Command
        Prompt", or something similar.  This will start a console window
        with the environment all set up.  If you want to use a different
        shell (highly recommended), then you'll have to copy the
        necessary components of the path into your system path (or the
        path of your shell), and define the environment variables LIB
        and INCLUDE with the values they have in this window.  (I've
        used VC++ from the command line in MSys, CygWin and UWin; I
        usually invoke it from a gmake file, however, which also works
        fine under Windows.  If you do use some of the Unix tool set,
        however, you might want to consider moving things around so that
        there are no spaces in any of the path names---you can make it
        work with spaces, but it's a lot more difficult.)
        >
        The actual command is cl.  Note that like most other compilers,
        you'll need a lot of options for it to be really usable.
        >
        --
        James Kanze (GABI Software)             email:james.ka. ..@gmail.com
        Conseils en informatique orientée objet/
                           Beratung in objektorientier ter Datenverarbeitu ng
        9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
        Sure, cl is the compiler command , as well as rc and link.
        On the other hand, you can download a Dev-C++,and put the bin
        directory
        to your system path,then you can use gcc, g++, etc.

        Comment

        • rufus

          #5
          Re: C++ Compiler for windows?


          "want.to.be.pro fesser" <guolihui112@gm ail.comskrev i en meddelelse
          news:b7db75e2-6529-463a-8781-6772f427c6f1@c5 8g2000hsc.googl egroups.com...
          On 7?13?, ??5?04?, James Kanze <james.ka...@gm ail.comwrote:
          On Jul 13, 9:55 am, "rufus" <as...@asd.comw rote:
          >
          Is there a C++ compiler for windows that can be run from the
          commmandline? I
          have only be able to find MS Visual Studio but its rather overkill since
          I
          also like to just use notepad for my code.
          >
          VC++ works fine from the command line. As far as I know, in
          fact, it can only be invoked from the command line---Visual
          Studios generates a command line to invoke it.
          >
          If you've installed Visual C++ correctly, there should be an
          entry in your program menus for "Visual Studio 2008 Command
          Prompt", or something similar. This will start a console window
          with the environment all set up. If you want to use a different
          shell (highly recommended), then you'll have to copy the
          necessary components of the path into your system path (or the
          path of your shell), and define the environment variables LIB
          and INCLUDE with the values they have in this window. (I've
          used VC++ from the command line in MSys, CygWin and UWin; I
          usually invoke it from a gmake file, however, which also works
          fine under Windows. If you do use some of the Unix tool set,
          however, you might want to consider moving things around so that
          there are no spaces in any of the path names---you can make it
          work with spaces, but it's a lot more difficult.)
          >
          The actual command is cl. Note that like most other compilers,
          you'll need a lot of options for it to be really usable.
          >
          --
          James Kanze (GABI Software) email:james.ka. ..@gmail.com
          Conseils en informatique orientée objet/
          Beratung in objektorientier ter Datenverarbeitu ng
          9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
          Sure, cl is the compiler command , as well as rc and link.
          On the other hand, you can download a Dev-C++,and put the bin
          directory
          to your system path,then you can use gcc, g++, etc.

          But will the executable compiled with a Dev-C++ gcc or g++ compiler be
          executable on windows XP?


          Comment

          • rufus

            #6
            Re: C++ Compiler for windows?


            "Leclerc" <gordan.sikic.r emove@this.inet .hrskrev i en meddelelse
            news:g5cesb$pbo $1@sunce.iskon. hr...
            rufus wrote:
            >Is there a C++ compiler for windows that can be run from the
            >commmandline ? I have only be able to find MS Visual Studio but its
            >rather overkill since I also like to just use notepad for my code.
            >
            Well,
            all of them can be run from command line.
            >
            For MS VC, you need to start "Visual Studio 20XX Command prompt" and after
            that issue CL command. Alternative would be to start cmd.exe, and after
            that execute vcvars32.bat, located in BIN directory of VC distribution.

            Hm this works fine with cmd. But if I try the same with Windows PowerShell
            nothing happens when I type "cl.exe", not even an error message.
            >
            >

            Comment

            • Jerry Coffin

              #7
              Re: C++ Compiler for windows?

              In article <4879b4d6$0$902 70$14726298@new s.sunsite.dk>, asdff@asd.com
              says...
              Is there a C++ compiler for windows that can be run from the commmandline? I
              have only be able to find MS Visual Studio but its rather overkill since I
              also like to just use notepad for my code.
              You can still run the compiler with Visual Studio from the command line.
              If you prefer something else, there are a few possibilities:

              1) Microsoft Platform SDK (http://tinyurl.com/m3nld)
              2) Borland (http://www.codegear.com/downloads/free/cppbuilder)
              3) Digital mars (http://www.digitalmars.com/download/dmcpp.html)
              4) MingW (http://www.mingw.org/node/19)
              5) CygWin (http://www.cygwin.com/setup.exe)
              6) ConceptGCC (http://www.generic-
              programming.org/software/ConceptGCC/download.php)

              If you're primarily interested in developing Windows applications and
              happen to use C++, MS is probably the best choice -- but otherwise, it's
              probably the furthest from conforming with the standard of those listed
              here.

              If you really wish you were doing your development under Linux, but
              happen to be running Windows, CygWin is undoubtedly the best choice --
              but otherwise, it's going to be a PITA because it's doing its best to be
              BE Linux, despite running under Windows.

              If you want to experiment with the latest and greatest language
              features, ConceptGCC is almost certainly the best choice -- but
              otherwise, it's stupidly slow, allows a lot of code that isn't (yet)
              allowed by the standard.

              I won't try to go through the strengths and weaknesses of every one, but
              you get the general idea...

              --
              Later,
              Jerry.

              The universe is a figment of its own imagination.

              Comment

              • James Kanze

                #8
                Re: C++ Compiler for windows?

                On Jul 13, 11:21 am, "want.to.be.pro fesser" <guolihui...@gm ail.com>
                wrote:
                On 7月13日, 下午5时04分 , James Kanze <james.ka...@gm ail.comwrote:
                On Jul 13, 9:55 am, "rufus" <as...@asd.comw rote:
                Is there a C++ compiler for windows that can be run from
                the commmandline? I have only be able to find MS Visual
                Studio but its rather overkill since I also like to just
                use notepad for my code.
                VC++ works fine from the command line. As far as I know, in
                fact, it can only be invoked from the command line---Visual
                Studios generates a command line to invoke it.
                If you've installed Visual C++ correctly, there should be an
                entry in your program menus for "Visual Studio 2008 Command
                Prompt", or something similar. This will start a console window
                with the environment all set up. If you want to use a different
                shell (highly recommended), then you'll have to copy the
                necessary components of the path into your system path (or the
                path of your shell), and define the environment variables LIB
                and INCLUDE with the values they have in this window. (I've
                used VC++ from the command line in MSys, CygWin and UWin; I
                usually invoke it from a gmake file, however, which also works
                fine under Windows. If you do use some of the Unix tool set,
                however, you might want to consider moving things around so that
                there are no spaces in any of the path names---you can make it
                work with spaces, but it's a lot more difficult.)
                The actual command is cl. Note that like most other compilers,
                you'll need a lot of options for it to be really usable.
                Sure, cl is the compiler command , as well as rc and link.
                Never heard of rc, but cl is actually a compiler driver, like
                g++ or CC (Sun), or most others. You don't actually invoke
                link directly, you do it through cl.
                On the other hand, you can download a Dev-C++,and put the bin
                directory to your system path,then you can use gcc, g++, etc.
                But why? The more or less standard compiler for Windows is
                VC++. The only reason I can think of for using g++ under
                Windows is portability: you want to use the same sources under
                Windows as you did under Linux, without worrying about compiler
                idiosyncracies. Whereas I (personally) try to get my code to
                compile under as many different compilers as possible.

                --
                James Kanze (GABI Software) email:james.kan ze@gmail.com
                Conseils en informatique orientée objet/
                Beratung in objektorientier ter Datenverarbeitu ng
                9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

                Comment

                • James Kanze

                  #9
                  Re: C++ Compiler for windows?

                  On Jul 13, 12:10 pm, "rufus" <as...@asd.comw rote:
                  "want.to.be.pro fesser" <guolihui...@gm ail.comskrev i en
                  meddelelsenews: b7db75e2-6529-463a-8781-6772f427c6f1@c5 8g2000hsc.googl egroups.com...
                  On 7?13?, ??5?04?, James Kanze <james.ka...@gm ail.comwrote:
                  But will the executable compiled with a Dev-C++ gcc or g++
                  compiler be executable on windows XP?
                  I'm not sure what Dev-C++ is; I think it's an IDE, like Windows
                  Studio. But code compiled with g++ under MSys or CygWin on
                  Windows runs very well under all of the Windows I've tried it
                  on. (I haven't tried Vista yet, so I don't know. And I've not
                  tried with some of the older non-professional Windows, either,
                  before NT technology started being used on the personal systems
                  as well. But I can state from personal experience that there is
                  no problem with Windows NT, Windows 2000 or Windows XP.)

                  --
                  James Kanze (GABI Software) email:james.kan ze@gmail.com
                  Conseils en informatique orientée objet/
                  Beratung in objektorientier ter Datenverarbeitu ng
                  9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

                  Comment

                  • James Kanze

                    #10
                    Re: C++ Compiler for windows?

                    On Jul 13, 2:57 pm, Jerry Coffin <jcof...@taeus. comwrote:
                    In article <4879b4d6$0$902 70$14726...@new s.sunsite.dk>,
                    as...@asd.com says...
                    [...]
                    If you're primarily interested in developing Windows
                    applications and happen to use C++, MS is probably the best
                    choice -- but otherwise, it's probably the furthest from
                    conforming with the standard of those listed here.
                    Is that really true. The only other compiler on your list that
                    I've worked with is g++, and I'd rate recent versions of g++ and
                    VC++ fairly close; VC++ still has a few bugs with regards to
                    some of the more exotic uses of templates, but their library is
                    probably still slightly better than that of g++. But both are
                    to a point where you shouldn't notice the difference unless
                    you're writing very experimental code.

                    In the distant past: VC++ 6.0 was significantly more conform
                    than g++ 2.95.2, but there's no reason to use those versions
                    today.
                    If you really wish you were doing your development under
                    Linux, but happen to be running Windows, CygWin is undoubtedly
                    the best choice -- but otherwise, it's going to be a PITA
                    because it's doing its best to be BE Linux, despite running
                    under Windows.
                    Which is a PITA, even if you're a Unix freak, like I am. If I
                    want Linux, I know where to get it, and the cost isn't a
                    deterrant. There's such a thing as an emulation being too
                    exact; if I'm working under Windows, it's because I need simple
                    and direct access to the Windows features, and things like
                    making me type in /cygdrive/c/... rather than just c:/.. don't
                    help:-). (The worst in this regard is MSys. If an argument
                    starts with a '/', and the executable isn't in the MSys
                    directory, it replaces the '/' with 'c:\msys\...'. Which means
                    that 'cl /help' provokes a very strange error message about not
                    being able to find the file 'c:\...\help'.)

                    --
                    James Kanze (GABI Software) email:james.kan ze@gmail.com
                    Conseils en informatique orientée objet/
                    Beratung in objektorientier ter Datenverarbeitu ng
                    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

                    Comment

                    • Jerry Coffin

                      #11
                      Re: C++ Compiler for windows?

                      In article <3b2cca50-7a68-43ea-a884-505a92dc5ae9
                      @m3g2000hsc.goo glegroups.com>, james.kanze@gma il.com says...
                      On Jul 13, 2:57 pm, Jerry Coffin <jcof...@taeus. comwrote:
                      [ ... ]
                      If you're primarily interested in developing Windows
                      applications and happen to use C++, MS is probably the best
                      choice -- but otherwise, it's probably the furthest from
                      conforming with the standard of those listed here.
                      >
                      Is that really true. The only other compiler on your list that
                      I've worked with is g++, and I'd rate recent versions of g++ and
                      VC++ fairly close; VC++ still has a few bugs with regards to
                      some of the more exotic uses of templates, but their library is
                      probably still slightly better than that of g++.
                      Unfortunately, yes, it's really true. Not because Microsoft's compiler
                      is really that far behind everybody else, but because what they include
                      with the SDK is version 13.1, where Visual Studio currently comes with
                      version 15.x.

                      That's not so old that its conformance is truly terrible or anything
                      like that, but it's still old enough that I'm pretty sure most of the
                      others are closer.

                      --
                      Later,
                      Jerry.

                      The universe is a figment of its own imagination.

                      Comment

                      • Gennaro Prota

                        #12
                        Re: C++ Compiler for windows?

                        Jerry Coffin wrote:
                        In article <3b2cca50-7a68-43ea-a884-505a92dc5ae9
                        @m3g2000hsc.goo glegroups.com>, james.kanze@gma il.com says...
                        >On Jul 13, 2:57 pm, Jerry Coffin <jcof...@taeus. comwrote:
                        >
                        [ ... ]
                        >
                        >>If you're primarily interested in developing Windows
                        >>application s and happen to use C++, MS is probably the best
                        >>choice -- but otherwise, it's probably the furthest from
                        >>conforming with the standard of those listed here.
                        >Is that really true. The only other compiler on your list that
                        >I've worked with is g++, and I'd rate recent versions of g++ and
                        >VC++ fairly close; VC++ still has a few bugs with regards to
                        >some of the more exotic uses of templates, but their library is
                        >probably still slightly better than that of g++.
                        >
                        Unfortunately, yes, it's really true. Not because Microsoft's compiler
                        is really that far behind everybody else, but because what they include
                        with the SDK is version 13.1, where Visual Studio currently comes with
                        version 15.x.
                        >
                        That's not so old that its conformance is truly terrible or anything
                        like that, but it's still old enough that I'm pretty sure most of the
                        others are closer.
                        Pretty sure of something you haven't probably tried in a while.
                        Compilers evolve... VC++ was far behind the competition until a few
                        years ago but it has made very fast progresses starting with 7.1
                        (=.NET 2003, MSC_VER=1310). Have you really tried Digital Mars? Last
                        time I did --a couple of years ago-- it was _completely_ brain dead;
                        unusable for anything but toy examples. See e.g. this incredible bug:

                        <http://www.digitalmars .com/d/archives/c++/beta/596.html>

                        --
                        Gennaro Prota | <https://sourceforge.net/projects/breeze/>
                        Do you need expertise in C++? I'm available.

                        Comment

                        • James Kanze

                          #13
                          Re: C++ Compiler for windows?

                          On Jul 13, 8:04 pm, "Alf P. Steinbach" <al...@start.no wrote:
                          * James Kanze:
                          Which is a PITA, even if you're a Unix freak, like I am. If
                          I want Linux, I know where to get it, and the cost isn't a
                          deterrant. There's such a thing as an emulation being too
                          exact; if I'm working under Windows, it's because I need
                          simple and direct access to the Windows features, and things
                          like making me type in /cygdrive/c/... rather than just
                          c:/.. don't help:-). (The worst in this regard is MSys. If
                          an argument starts with a '/', and the executable isn't in
                          the MSys directory, it replaces the '/' with 'c:\msys\...'.
                          Which means that 'cl /help' provokes a very strange error
                          message about not being able to find the file
                          'c:\...\help'.)
                          He he.
                          Not so funny when you actually have to deal with the problem.
                          James, have you considered very very exact Microsoft's Windows
                          Services for Unix (SFU, formerly Interix IIRC) -- it's free,
                          or at least, was, a few years ago.
                          This is the first I've heard of it, but I'll look into it. (I'd
                          also like to try the MKS toolkit; I used it many, many years
                          back, under MS-DOS, and found it very good. But they've priced
                          it way out of my budget today.)

                          Thanks.

                          --
                          James Kanze (GABI Software) email:james.kan ze@gmail.com
                          Conseils en informatique orientée objet/
                          Beratung in objektorientier ter Datenverarbeitu ng
                          9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

                          Comment

                          • abracadabra

                            #14
                            Re: C++ Compiler for windows?

                            GCC compiler, Windows-friendly.

                            Comment

                            Working...