Thread: Good compiler

  1. #1
    Registered User cppprogrammer30's Avatar
    Join Date
    Aug 2013
    Posts
    3

    Good compiler

    Hi, I have been using Microsoft Visual Studio since I started programming. It is great and compiles fast. But, sometimes it says there is an error when there actually isn't . The only way I can fix it is by removing the code and then putting it back then (which can get annoying). But, it doesn't happen very often.

    So, what is another good compiler? I am using Windows 7.

    I am sorry if I put this in the wrong section of this forum. I am new to this forum, so I am still finding my way around.

    Thank you!
    cppprogrammer30

  2. #2
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    I use the Code Blocks IDE on my windows machines (XP and 7), which can be downloaded bundled with a port of gcc. It's free, open source, and very nice, in my opinion.

  3. #3
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Quote Originally Posted by cppprogrammer30 View Post
    Hi, I have been using Microsoft Visual Studio since I started programming. It is great and compiles fast. But, sometimes it says there is an error when there actually isn't . The only way I can fix it is by removing the code and then putting it back then (which can get annoying).
    Never happens to me. Could it be that code you are removing is not exactly the same as code you put back?

    If something like this is happening - have you tried "rebuild all" before doing your trick?

    Are you using "Precompiled headers"? I never use them. Seems to me they make more harm than help.

    I also mostly avoid "Build and Continue" feature of MSVC.

    So if you are using them - I suggest to try to disable them and see if problem persists.
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  4. #4
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Recent versions of Microsoft Visual Studio come bundled with pretty good compilers. Case of getting what you pay for. While gcc is pretty good, but recent versions don't stand up well when compared objectively with a number of recent commercial products - including Microsoft's. [Although compiler and other developer products have historically leap-frogged each other, so I wouldn't exclude the possibility of gcc jumping ahead in future].

    I'm with vart on turning off precompiled headers and suspecting the code you add is not what you removed. I never use precompiled headers for similar reasons, with any compiler. Precompiled headers have their uses but, in practice, I have rarely found benefits exceed the problems.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Clang is not bad compiler either and produces very helpful messages. You can grab it from https://sourceforge.net/projects/min...g-3.2-release/.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    Registered User cppprogrammer30's Avatar
    Join Date
    Aug 2013
    Posts
    3
    @vart
    It is the same code, I use Ctrl+C (copy) and Ctrl+V (paste). I am using precompiled header (I don't like using them, but I couldn't find where to turn them off).
    Last edited by cppprogrammer30; 08-06-2013 at 08:00 AM.

  7. #7
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    Often such problems are caused by you changing files during the build, or occasionally by cancelling the build at just the right moment.
    If it is the same code, then there are plenty of other ways to force the file to be recompiled. Right-click "recompile", or rebuild project, etc.

    What version of Visual Studio are you using?
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  8. #8
    Registered User
    Join Date
    Aug 2003
    Posts
    1,218
    Quote Originally Posted by grumpy View Post
    Recent versions of Microsoft Visual Studio come bundled with pretty good compilers. Case of getting what you pay for. While gcc is pretty good, but recent versions don't stand up well when compared objectively with a number of recent commercial products - including Microsoft's. [Although compiler and other developer products have historically leap-frogged each other, so I wouldn't exclude the possibility of gcc jumping ahead in future].

    I'm with vart on turning off precompiled headers and suspecting the code you add is not what you removed. I never use precompiled headers for similar reasons, with any compiler. Precompiled headers have their uses but, in practice, I have rarely found benefits exceed the problems.
    In what way doesn't GCC stand up to Microsofts compiler? Just curious because if you look at C++11 support then GCC (and Clang) are ahead of Microsofts latest VS 2012 compiler.

  9. #9
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Quote Originally Posted by Shakti View Post
    In what way doesn't GCC stand up to Microsofts compiler? Just curious because if you look at C++11 support then GCC (and Clang) are ahead of Microsofts latest VS 2012 compiler.
    There are many objective and subjective measures by which compilers can be compared - compliance with a particular standard is only one of them. gcc support of C++11 (according to the gcc site) is experimental (which typically means "use at own risk") whereas Visual Studio support of C++11 - according to Microsoft - is incomplete. I'm not going to buy into a debate about whether experimental support of a language is better or worse than incomplete support.

    However, to answer your question, one area where modern versions of gcc fall down somewhat is in quality of code generated. Not that they are bad (I would argue that few modern compilers are really bad) but recent versions of Microsoft compilers are measurably better, in terms of amount of code generated, performance of that code, and memory usage.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  10. #10
    Tweaking master Aslaville's Avatar
    Join Date
    Sep 2012
    Location
    Rogueport
    Posts
    528
    is experimental (which typically means "use at own risk")
    Yea its like using a mainline kernel only to lose very valuable data

  11. #11
    Registered User
    Join Date
    Aug 2003
    Posts
    1,218
    Quote Originally Posted by grumpy View Post
    However, to answer your question, one area where modern versions of gcc fall down somewhat is in quality of code generated. Not that they are bad (I would argue that few modern compilers are really bad) but recent versions of Microsoft compilers are measurably better, in terms of amount of code generated, performance of that code, and memory usage.
    Ah didn't know that one. Thanks for the clarification.

  12. #12
    Registered User
    Join Date
    Mar 2013
    Posts
    63
    I use a number of different c/c++ compilers for testing of my Basic -> c/c++ translator.


    I do all my compiling from batch files and never did find a way to use the latest Microsoft C++ compiler.
    I installed the Win7 SDK and use that version. A bit dated on it's C++11 support.


    I did until recently use this outstanding MinGW distro: MinGW Distro - nuwen.net
    STL, the projects maintainer, is an MS employee and the page is a good read as well as his other articles.
    It is based on the official MinGW port and as such it has an issue with a couple new C++11 items.
    stof
    stod
    stoi
    are not supported
    It is also 32bit only


    So for now my favorite distro are from here:


    MinGW-builds - Browse /host-windows/releases/4.8.1 at SourceForge.net


    Both 32 and 64 bit


    The biggest issue I have with any of the gcc ports is the size of the executable, especially if iostream is included. I am a bit vague on the whys but it may be to static linking of some of the libraries where MS is using OS dll's?




    James

  13. #13
    Registered User cppprogrammer30's Avatar
    Join Date
    Aug 2013
    Posts
    3
    @iMalc
    Sorry, It has been 13 hours since your reply. It has been a while since I could get to my computer. I am using VS 2012 Express

  14. #14
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Quote Originally Posted by Elysia View Post
    Clang is not bad compiler either and produces very helpful messages. You can grab it from https://sourceforge.net/projects/min...g-3.2-release/.

    Can you tell me which gcc-dw2-4.6* package I need to download to get it to work on Windows 7 32-bit?

    My internet is slow; I would like to avoid downloading the wrong ones in trial and error.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  15. #15
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Quote Originally Posted by stahta01 View Post
    Can you tell me which gcc-dw2-4.6* package I need to download to get it to work on Windows 7 32-bit?

    My internet is slow; I would like to avoid downloading the wrong ones in trial and error.

    Tim S.
    Download MinGW-w64 - for 32 and 64 bit Windows from SourceForge.net

    Got no answer, I tried i686-w64-mingw32-gcc-dw2-4.6.3-2-release-win32_rubenvb.7z and it appears to work.
    At least "Hello World" worked with C++.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A good C compiler
    By Strahd in forum C Programming
    Replies: 15
    Last Post: 09-30-2011, 01:56 AM
  2. How good is the compiler of VS .NET Pro, really?
    By lightatdawn in forum Windows Programming
    Replies: 5
    Last Post: 03-23-2004, 02:58 PM
  3. Good dos compiler
    By miclus in forum C++ Programming
    Replies: 7
    Last Post: 01-04-2004, 01:04 AM
  4. A good C++ compiler
    By Cris987 in forum C++ Programming
    Replies: 15
    Last Post: 01-02-2004, 08:42 AM
  5. Know a good C Compiler?
    By Unregistered in forum C Programming
    Replies: 5
    Last Post: 02-05-2002, 06:41 AM