#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2011
    Posts
    99
    Rep Power
    0

    Command Line C++ Compiler for 64-bit Windows 7


    I mostly use Java and web languages so i do not have much idea on this topic. My request may sound vague and noobish, but please co operate.

    From the past hour, i ve been searching for a good enough compiler for C++ that works on a command line window ( cmd ) and works on 64 bit windows 7 . Ive come across borland, gcc and turbo c++ but most of them either dont support command line functions or d not run on 64 bit.

    The closest i came to was PellesC. But the surprising fact was that it did not even have the iostream library!!! For Java, i used to just run a simple javac command on cmd and it runs smooth. Is there any compiler from which i can get similar results??

    Here are the specs required again...must support command line, must run on 64 bit windows 7, must contain all required libraries. Its fine even if the compiler comes along with an ide (although i will not be using it). An help would be highly appreciated
  2. #2
  3. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,145
    Rep Power
    2222
    I copied my MinGW gcc to my Windows 7 box, 64-bit, and it works fine, as far as I can tell and recall. I think if you go to the MinGW site that they even have a 64-bit version. And I only use it from the command line.

    I can tell you more when I get home in another 10 hours.
  4. #3
  5. Contributing User

    Join Date
    Aug 2003
    Location
    UK
    Posts
    5,109
    Rep Power
    1802
    All C / C++ compilers are command line tools. The IDE's that some compilers are integrated with are not the compiler itself, just the integration compiler, linker, build tools, editor and debugger. They simply drive the compiler (and other tools) via ... guess what? - its command line interface.

    Do you want a compiler that generates Win64 code or merely one that works on Win64? Any Win32 compiler will work on Win64, as will the code it generates (albeit in the WoW32 subsystem).

    If you truely want a command line toolchain and nothing more, then consider http://mingw-w64.sourceforge.net/, or its more mature 32bit-only variant http://www.mingw.org/

    However regardless of how much of a command-line junkie you are, any serious development needs a serious debugger, and that provided with MSVC++ is hard to better, even in the free express editions, which still has command line interfaces to all the tools - compiler, linker, make utility etc. The command line interfaces for VC++2010 are described at http://msdn.microsoft.com/en-us/library/f35ctcxw%28v=VS.100%29.aspx. You can even invoke the Vc++ debugger from teh command line thus:

    Code:
    start msdev filename argument
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2011
    Posts
    99
    Rep Power
    0
    @dwise1_aol MinGW 64 bit?? i guess i must have missed that while searching yesterday... Will surely give it a try .


    @clifford
    Any Win32 compiler will work on Win64, as will the code it generates
    well not exactly.....the version of MinGW which i used yesterday gave the following error message:

    "The version of this file is not compatible with the version of Windows you're running. Check your computer system infromation to see whether you need an x86 (32-bit) or x64 (64-bit) version of the program, and then contact the software publisher."

    Do you want a compiler that generates Win64 code or merely one that works on Win64?
    the latter....it doesnt matter if the resultant code is in Win32 format
    And like i mentioned above, i will surely try out the MinGW you had hyperlinked

    Thanks a lot clifford, you cleared a lot of my "old" doubts and i think i'll stick to plain mingw...i'll go to the debuggers if i ever meet the need
  8. #5
  9. Contributing User

    Join Date
    Aug 2003
    Location
    UK
    Posts
    5,109
    Rep Power
    1802
    Originally Posted by Lokesh1996
    .i'll go to the debuggers if i ever meet the need
    If you don't think you need a debugger, you are probably wrong, or at least destined to be less productive. They serve multiple purposes:

    • Debugging tricky problmes without modifying/rebuilding the code.
    • Stepping through code for "white-box" testing.
    • Stepping through code to learn how it works and behaves at the lowerst possible level.


    So it will help you learn, help make your code more robust, and help your code to work. What is more, spend half an hour to learn teh basics of how to use the debugger effectively, you will easily save yourself half an hour every day (assuming normal working hours and a reasonably substantial project).

    Look at it this way; most of the people posing questions on this forum are probably not using a debugger. That is not because most people don't use a debugger - the ones that are have far less reason to resort to this rather less efficient method of debugging! Wait 24 hours for all time zones to read and possibly answer your question, or fix it in a minute with a debugger - your choice.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2011
    Posts
    99
    Rep Power
    0
    @clifford ... I understand and agree that having a debugger at your side can make things faster ...

    At the beginning when i was new to coding. i used debuggers a lot .... but by now im used to programming and thus whenever i code, i find myself making spelling errors very rarely and i have a LOT of time, since im just in high school...

    I even like to figure out myself why codes are not executing properly ..

    Well .. this habit of mine began ever since i started web designing as there .. an error means a blank white screen

    Which is why i said i will start using a debugger when i seriously need one ...

    i agree that using a debugger can b VERY useful... but im habituated ...

    Cheers.
  12. #7
  13. Contributing User

    Join Date
    Aug 2003
    Location
    UK
    Posts
    5,109
    Rep Power
    1802
    Originally Posted by Lokesh1996
    At the beginning when i was new to coding. i used debuggers a lot .... but by now im used to programming and thus whenever i code, i find myself making spelling errors very rarely and i have a LOT of time, since im just in high school...
    Debuggers don't fix spelling errors. The assist you in fixing semantic errors. Perhaps you are thinking of static analysis tools such as Lint?

    Originally Posted by Lokesh1996
    I even like to figure out myself why codes are not executing properly ..
    Well a debugger assists you in doing exactly that. It does not find bugs for you. If you were a doctor would you not use a stethoscope of an X-Ray to make a diagnosis because it was "too easy"!? Of course not, you would use the best diagnostic tools available to you. The real high-level skill in software development is in design, not in grunt coding. Spend your time creating good code design, and then let the debugger help you through the more mechanistic task of implementing and testing the design.

    Of course if you eschew the use of an IDE, there is probably some in-built impedance to using a debugger since it does not become a natural part of the work-flow.
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2011
    Posts
    99
    Rep Power
    0
    alright clifford

    i think its ok to start considering a debugger
    i am gonna need starting help.

    could you suggest a tutorial on a debugger?
  16. #9
  17. Contributing User

    Join Date
    Aug 2003
    Location
    UK
    Posts
    5,109
    Rep Power
    1802
    Originally Posted by Lokesh1996
    alright clifford

    i think its ok to start considering a debugger
    i am gonna need starting help.

    could you suggest a tutorial on a debugger?
    That will depend on what tool-chain you are using. If using GCC your basic debugger is GDB. You may like it - it is a command line oriented tool, but for most people it is a difficult, cumbersome and confusing interface - though ultimately very powerful.

    There are graphical wrappers around GDB that allow "visual" debugging, such as Insight, or integrations with IDE's such as Eclipse.

    By far the best debug "experience" as I have already stated is provided by VC++. If using it within teh IDE you can even benefit from "edit and continue" operation, where you make a change in your code and the code is recompiled and its state restored so that you continue from where you are with the corrected code.
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2011
    Posts
    99
    Rep Power
    0
    GDB sounds good ... as i had previously expressed my views about command line tools ..

    Im currently using MinGW , so are they compatible??

IMN logo majestic logo threadwatch logo seochat tools logo