Kushal
Kushal

Reputation: 3178

A simple "javac" style command-line C/C++ compiler for Windows 7

Over the last couple of months I practiced console programming with Java just with the help of JDK and a text editor of my choice (Notepad++). And I loved the simplicity as a program can be compiled from the command line plainly using javac and run using java.

Now, I'm looking for similar compiler for C/C++, such that I create a .c or .cpp file and compile it in the command prompt, and all it does is create a "native" executable that can be run directly from the command prompt. Thus, without any need of bloated IDE. The reason I'm looking for such simple compiler is because it is going to be used by high-school students so I'm advised to avoid any IDE as far as possible, so students can practice all the concepts of C/C++ languages without having to go for IDE. Which compiler can I use that does this job? also, I must work across all the versions Windows starting from Windows XP.

Upvotes: 2

Views: 3847

Answers (7)

rdk
rdk

Reputation: 109

I too use VisualStudio on Windows from the command prompt and use VS Make files as well. That way, I can smb mount my source code from a different machine and perform compiles on several different platforms at once (e.g. Windows, Linux, Solarsi).

Upvotes: 1

David X
David X

Reputation: 4176

MinGW GCC is definitely the way go, but I would recomend the nuwen.net distro (http://nuwen.net/mingw.html). Haven't used it in a while (yay unix!), but if IIRC, it comes with everything ready to go after unpacking. The official distribution is ... very hard to get working.

Upvotes: 2

user2100815
user2100815

Reputation:

You should certainly consider using MinGW GCC, but not by download from the MiNGW web page, unless you are some kind of masochist. Get the one packaged by Twilight Dragon Media at http://tdm-gcc.tdragon.net.

Upvotes: 1

daalbert
daalbert

Reputation: 1475

Visual Studio includes the ability to compile from the command line. Like others just said you can look at cygwin/MinGW. I would recommended using Code::Blocks or Dev-C++. I know you stated you do not want an IDE, but I would highly suggest a minimalist IDE like the ones I just suggested, or at least SciTE or Notepad++ to get some basic syntax highlighting with the ability to configure build tools if you want as well.

Upvotes: 2

Constantinius
Constantinius

Reputation: 35069

A very simple solution woul be cygwin and MinGW, which provides an environment very similar to a UNIX shell. Then you can use the make utilities to compile your program.

Upvotes: 1

Charbel
Charbel

Reputation: 14697

http://gcc.gnu.org/gcc is a multi platform c/c++ compiler

Upvotes: 2

ThiefMaster
ThiefMaster

Reputation: 318688

You can download MinGW which is basically GCC for windows.

Then you can simply gcc somefile.c to create an executable.

Upvotes: 6

Related Questions