Shop OBEX P1 Docs P2 Docs Learn Events
Recomendations for a c/c++ compiler for windows? — Parallax Forums

Recomendations for a c/c++ compiler for windows?

vanmunchvanmunch Posts: 568
edited 2014-01-02 16:52 in General Discussion
Hey Everyone,

I didn't think that this would be too hard to do, but I am having a difficult time finding a c/c++ compiler for windows. It seams like there are a lot of them out their, but they look like they're half-baked. I don't mind spend some money for one (up to $100). What do you recommend? What are you using?

Thanks again for your time,

Dave

Comments

  • mindrobotsmindrobots Posts: 6,506
    edited 2013-12-31 20:37
    I've always just installed Cygwin and used gcc but it has extra work if you want to create a distributable package, I believe.It's always just been for personal play.
  • jazzedjazzed Posts: 11,803
    edited 2014-01-01 09:32
  • David BetzDavid Betz Posts: 14,516
    edited 2014-01-01 09:34
    vanmunch wrote: »
    Hey Everyone,

    I didn't think that this would be too hard to do, but I am having a difficult time finding a c/c++ compiler for windows. It seams like there are a lot of them out their, but they look like they're half-baked. I don't mind spend some money for one (up to $100). What do you recommend? What are you using?

    Thanks again for your time,

    Dave

    Visual Studio Express is quite good. The latest version is 2013 I think.

    http://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx
  • vanmunchvanmunch Posts: 568
    edited 2014-01-01 09:52
    Thank you. I originally tried mingw, but I got lost in the "post" installation process where you have to create your own shells and I didn't realize that it is "just" the compiler. I thought it would be more similar to the Propeller Tool.

    Visual Studios looks good, but I'm trying to learn C and it looks like it only does C++? Also, do all of the programs that you write run through .net?

    I just downloaded NetBeans and I'm going to see how it goes. Has anyone worked with it before?

    Thank you again for your help!

    Dave
  • David BetzDavid Betz Posts: 14,516
    edited 2014-01-01 09:56
    vanmunch wrote: »
    Thank you. I originally tried mingw, but I got lost in the "post" installation process where you have to create your own shells and I didn't realize that it is "just" the compiler. I thought it would be more similar to the Propeller Tool.

    Visual Studios looks good, but I'm trying to learn C and it looks like it only does C++? Also, do all of the programs that you write run through .net?

    I just downloaded NetBeans and I'm going to see how it goes. Has anyone worked with it before?

    Thank you again for your help!

    Dave
    Any compiler that will do C++ will probably also do C. That is certainly true of earlier versions of Visual Studio and I can't imagine that's changed. I'm not sure about requiring .NET. I now earlier versions of Visual Studio could generate standalone apps but I don't know if that feature has been removed in current versions. Visual Studio has a very nice debugger. That's one reason I liked using it when I was doing development on Windows machines.
  • jazzedjazzed Posts: 11,803
    edited 2014-01-01 10:03
    PropellerTool is designed for people with no previous programming experience at all (a very large market relatively speaking).

    MinGW is designed to be used by other development environments and is sometimes packaged (Bloodshed Dev-C++).

    Netbeans, Eclipse, Bloodshed Dev-C++, and many others use mingw in the background. Not sure if NetBeans has an easy way to get MinGW (it's mostly a Java thing).

    I don't recommend Cygwin. It is a horrible and miserably slow psuedo-linux variation.

    I recommended VSC++ 2010 only because that was the last version I used. Any C++ dev platform will also compile C programs.

    vanmunch wrote: »
    Thank you. I originally tried mingw, but I got lost in the "post" installation process where you have to create your own shells and I didn't realize that it is "just" the compiler. I thought it would be more similar to the Propeller Tool.

    Visual Studios looks good, but I'm trying to learn C and it looks like it only does C++? Also, do all of the programs that you write run through .net?

    I just downloaded NetBeans and I'm going to see how it goes. Has anyone worked with it before?

    Thank you again for your help!

    Dave
  • Heater.Heater. Posts: 21,230
    edited 2014-01-01 10:26
    Doesn't the Qt Creator IDE for Windows come with a C/C++ compiler?
  • vanmunchvanmunch Posts: 568
    edited 2014-01-01 10:28
    Great, thanks for the info. I found that NetBeans has to be tied to mingw and is even more complicated. I'm installing Microsoft Visual 2010 right now and it looks like you have the option of creating stand alone programs or one that run through .net.

    I had no idea that this would take so much time... :)

    Thanks again for the help!

    Dave
  • jmgjmg Posts: 15,173
    edited 2014-01-01 11:41
    Depending on what you want to do, there is a fish-hook in the express version re no MFC support

    see
    http://stackoverflow.com/questions/5543523/afxwin-h-file-is-missing-in-vc-express-edition
  • vanmunchvanmunch Posts: 568
    edited 2014-01-02 06:41
    So I just wanted to give an update and let anyone else know what I did.

    Microsoft Visual Studios is by far the easiest to install and get started with. I've downloaded and installed the 2010 version just because that's what other people had mentioned. I've been able to compile C programs by opening a "empty" project and renaming the file extension to .C following the instructions that I found here: http://stackoverflow.com/questions/3327199/how-can-i-use-visual-studio-2010-for-c-development

    Anyhow, I hope this helps someone else and thanks again to everyone for your advice and help! :)

    Dave
  • davejamesdavejames Posts: 4,047
    edited 2014-01-02 06:48
    Hi Dave - one of the differences between Visual Studio and Visual Studio Express (IIRC) is that the Express version does not output a standalone executable (requires the potentially large .net package), where the standard product gives the option of either.

    I've used VS2005 at work and home for a number of years and found it to be a very good product. My day-job will begin to use VS2010 later this year.
  • David BetzDavid Betz Posts: 14,516
    edited 2014-01-02 07:10
    davejames wrote: »
    Hi Dave - one of the differences between Visual Studio and Visual Studio Express (IIRC) is that the Express version does not output a standalone executable (requires the potentially large .net package), where the standard product gives the option of either.

    I've used VS2005 at work and home for a number of years and found it to be a very good product. My day-job will begin to use VS2010 later this year.
    You say you'll be beginning to use VS2010 later this year. Any reason you're not using VS2013? Has anyone tried this? Are there problems with it?
  • davejamesdavejames Posts: 4,047
    edited 2014-01-02 07:40
    David Betz wrote: »
    You say you'll be beginning to use VS2010 later this year. Any reason you're not using VS2013? Has anyone tried this? Are there problems with it?

    Only because we're behind the "release curve" of Microsoft products.

    Our test system software has some levels of hooks into VS. Upgrading that software becomes a herculean effort when VS has a new release. I'm gonna guess VS2010 was chosen because that's what was available when the S/W department decided to move from WinXP to Win7 for the tester operating system.

    Yes - changes occur slowly when a company has thousands of installed systems...
  • jmgjmg Posts: 15,173
    edited 2014-01-02 12:29
    davejames wrote: »
    Hi Dave - one of the differences between Visual Studio and Visual Studio Express (IIRC) is that the Express version does not output a standalone executable (requires the potentially large .net package), where the standard product gives the option of either.
    There may be some caveats here ?

    It seems to work on these tests I just did of some teensy tutorials I found on my hard drive:
    These are all Win32 Console Apps, which are probably fine for most readers here.
    VC++ 2008  Win32 Debug/Release          Run:SamePC       Run:OtherPC
                          Debug   Release  Debug   Release  Debug   Release  
    aliens.exe  EXE Size : 30k    10k      Yes     Yes      No*     Yes 
    If.exe      EXE Size : 28k     8k      Yes     Yes      No*     Yes 
    Loops.exe   EXE Size : 28k     7k      Yes     Yes      No*     Yes 
    * XP Message is : ["The system cannot execute the specified application"]
    * Win 8.1 Laptop has a different message, but also runs  Release fine.
    

    Test is to copy to FlashDrive and then run on SamePC, or OtherPC (No VC++ install)
    Select Debug or Release in the top line & rebuild to create exe's.
  • KyeKye Posts: 2,200
    edited 2014-01-02 12:56
    Use Qt (it's C++):

    http://qt-project.org/downloads

    There's lots of examples on how to do stuff and you don't have to fiddle with build scripts. Releasing you code for windows is also pretty straight forward and just involves copying a bunch of .dll files to the same directory as your .exe.

    Additionally, the code you write in Qt is cross platform. I suggest reading up on how to work with Qt before creating you first GUI or command line application. Otherwise, you may end up wasting a lot of your time redoing things after you learn the proper way to do them. In particular, when making GUIs use the layout system...

    https://play.google.com/store/books/details?id=TjR2G7BXkO8C&source=productsearch&utm_source=HA_Desktop_US&utm_medium=SEM&utm_campaign=PLA&pcampaignid=MKTAD0930BO1
  • Heater.Heater. Posts: 21,230
    edited 2014-01-02 13:03
    I second the Qt suggestion. This is 2014 we should not be writing OS dependent apps any more unless really necessary. Qt Creator is a great IDE, the Qt documentation is extensive and clear. Your finished programs will be runnable on Linux, Mac and even tablets under Android. Oh yeah, even those old legacy Microsoft operating systems.

    As a fine example check out SimpleIDE. A nice IDE for Spin and C/C++ that runs everywhere, even on the Raspberry Pi.
  • KC_RobKC_Rob Posts: 465
    edited 2014-01-02 13:22
    Heater. wrote: »
    Qt Creator is a great IDE, the Qt documentation is extensive and clear.
    I'll "third" this. It even has decent Vim emulation.
  • David BetzDavid Betz Posts: 14,516
    edited 2014-01-02 13:30
    KC_Rob wrote: »
    I'll "third" this. It even has decent Vim emulation.
    Is the QT debugger decent? That's one of the things I really liked about VC. Even when I was targetting another processor, I often debugged what I could under VC because it had a better debugger than most any other IDE I tried.
  • KC_RobKC_Rob Posts: 465
    edited 2014-01-02 13:55
    David Betz wrote: »
    Is the QT debugger decent? That's one of the things I really liked about VC. Even when I was targetting another processor, I often debugged what I could under VC because it had a better debugger than most any other IDE I tried.
    I don't know that you'll like it as much as VC's but I would certainly give it a decent rating. The code helpers and completion are likewise quite good, then of course there's the Vim emulation. For a while I was even using QT Creator to write code for AVRs and other microcontrollers, but I ended up switching back to Emacs + EVIL.

    Frankly, I haven't updated my installation for some time. So I'm sure many features work even better than when last I used them. I've always seen consistent improvements whenever I've updated to the latest version (a good sign!).
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2014-01-02 15:29
    This says solved, but adding my two bits.

    I started out wanting to be able to compile pic32 type C, as a test bed for the GUI on a 128x64 lcd. However, I soon found that microchip c will not compile on visual studio C, mainly because its not c99?? compliant. All local variable declarations have to be at the head of the function, which is an annoyance.

    This led me to mingw and netbeans, with which I am familiar because of mplabx. Mingw happily compiles my code with the proper processor changes, and handles bitness the same as microchip. Therefore, I recommend mingw over vc++ at this point.

    Now, if you wish to dig into c++, it may be different. However, once again be warned that Microsoft C++ is not completely compatible with everyone else. Especially if you want to use .net gui c++. I personally use it, but detest it compared to c.

    I tried vs2013, can see no current benefit. ALL THE MENUS ARE CAPS FOR SOME REASON. For now am staying with 2008. All the nice c++ features they made available are only for win 8 apps.
  • jazzedjazzed Posts: 11,803
    edited 2014-01-02 15:41
    Qt is fine. It's getting harder to install though :)

    Remember that one of the main benefits of Qt is the Q* framework. It uses MinGW (or that M$ junk if you prefer it). If you want straight up C/C++ you don't need Qt, but Qt's library framework is much nicer than the standard libc++std stuff especially regarding templates.

    Qt applications will run practically everywhere, so that's something to consider. SimpleIDE is stuck in 4.8 library land at the moment, but will move to 5.2+ libraries given the chance (and my motivation).
  • RoadsterRoadster Posts: 209
    edited 2014-01-02 16:52
    I like code blocks http://www.codeblocks.org, it also installs mingw and istall on windows, linux and mac
Sign In or Register to comment.