Where can I find a good compiler for learning C++ on Windows?

  • Context: C/C++ 
  • Thread starter Thread starter triac
  • Start date Start date
  • Tags Tags
    Mind
Click For Summary

Discussion Overview

The discussion centers around finding a suitable compiler for learning C++ on Windows, with participants sharing their experiences and recommendations. The scope includes suggestions for IDEs, installation notes, and basic programming issues encountered by beginners.

Discussion Character

  • Exploratory
  • Technical explanation
  • Homework-related

Main Points Raised

  • One participant inquires about good compilers for learning C++ on Windows.
  • Several participants recommend Bloodshed Dev-C++ as a good starting point, noting its ease of use and integration with the gcc compiler via MinGW.
  • Another participant suggests Eclipse as an alternative, mentioning that it has similar functionality for C++ as it does for Java.
  • Microsoft Visual C++ Express is also mentioned as a free option suitable for beginners.
  • A participant shares their experience with using Notepad++ for coding in multiple languages, including C++.
  • One participant describes an issue with a basic program not displaying output as expected, prompting suggestions to add a pause command or adjust settings in Dev-C++ to keep the console open.
  • Another participant provides a solution to the output issue by suggesting the use of `system("PAUSE");` to keep the console window open after program execution.
  • A later reply mentions that running the compiled executable from the command line could be a better approach for managing output.
  • One participant recommends "Accelerated C++" as a good resource for learning the language.

Areas of Agreement / Disagreement

Participants generally agree on the suitability of Bloodshed Dev-C++ and Microsoft Visual C++ Express as good options for beginners, but there are multiple recommendations and no consensus on a single best choice. The discussion remains unresolved regarding the best practices for running and testing C++ programs.

Contextual Notes

Some participants mention specific features of the compilers and IDEs, but there are no detailed discussions on the limitations or requirements of each tool. The conversation includes various assumptions about the user's familiarity with programming environments.

Who May Find This Useful

Beginners looking to learn C++ programming on Windows, individuals seeking recommendations for compilers and IDEs, and those interested in basic programming troubleshooting.

triac
Messages
19
Reaction score
0
Hi!
I would like to learn programming (I'm a beginner except for some programs on my calculator), and I need help. I had in mind to begin with C++, but I don't know of any good compiler for Windows. If anybody knows of one, and could tell me how I use the compiler (the language itself I can learn from a book or just by studying other programs), please tell me.
Thanks!
 
Technology news on Phys.org


I used bloodshed when I started. This was a long time ago though. But I remember it being good http://www.bloodshed.net/

But I would probably recommend eclipse now. To learn how to use it, read the documentation on the web.

http://www.eclipse.org/downloads/

For a tutorial, here is one for Java. https://eclipse-tutorial.dev.java.net/ Eclipse appears to be the same for me in both languages. So, the IDE (compiler) should be the same. Best of luck!
 
Last edited by a moderator:


I agree on Bloodshed for Windows. Compiling is quite easy, you just load the .cpp file and it's a single click (or keystroke) to compile. I can't say which right now as I don't have it installed currently, but should be easy to figure out.
http://www.bloodshed.net/devcpp.html

I do that actual programming in Notepad++, which is a text editor with advanced features. I program several different languages and use Notepad++ for all of them.
 


Microsoft Visual C++ Express is pretty good (and also free; a bunch of open-source / hobbyist projects are starting to use it for their compilations now):
http://www.microsoft.com/express/vc/
 
Last edited by a moderator:


I'll third bloodshed with a little exposition. Bloodshed (I think) actually installs the gcc compiler on your computer (which is practically universal except for things like intel compilers). I think bloodshed (don't quote me on this though) actually installs MinGW to run gcc (getting swamped with acronyms yet? MinGW stands for "Minimal GNU for windows", if you want a laugh look up what GNU means in wikipedia.). I assume you are talking about windows. Bloodshed's Dev-c++ should automatically configure the compiler so that stuff written in Dev-c++ can be compiled.

So, the information I'm trying to get across is that (for your own understanding when reading about compilers and such in books), when you run the bloodshed dev-c++ installer you are actually compiling using gcc through MinGW. If you want to play around with code writing in unix (which is where most physics related programming is done) then you also might want to look into Cygwin and learn how to code and compile on that.
 


Ok, thanks a lot everybody!
So, I downloaded Dev-C++ 4.9.9.2 and wrote some really basic program like this:
#include <cstdlib>
#include <iostream>

using namespace std;

int main()
{
count<<"My first program";
return 0;
}

and then I chose compile and run. The compilation seemed to be successful but then a window (which I assumed was the running program) popped up but only for a fraction of a section. Has anybody got any idea of what's wrong?
 


You have to add system("PAUSE"); like this:

Code:
#include <cstdlib>
#include <iostream>

using namespace std;

int main()
{
    
    cout << "My first program" << endl;
    system("PAUSE");
    return 0;
}

The << endl part is just optional. It stands for end line. If you use cout again the output will appear in the next line.
 


Thanks!
 


triac said:
Thanks!


Ya, dev-c++ does that, you can enable "keep console open after running" or some such in options or only use dev-c++ to compile and then run the *.exe from the appropriate folder in DOS (which is the better way to do it since you can do things like redirect the output to file and such)
 
  • #10

Similar threads

Replies
6
Views
3K
  • · Replies 17 ·
Replies
17
Views
4K
Replies
14
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
69
Views
11K
  • · Replies 25 ·
Replies
25
Views
1K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 39 ·
2
Replies
39
Views
5K