Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ Compiler for Windows without IDE? [closed]

I'm looking for just a compiler for C++ (such as g++) for Windows, that I could run in my cmd.

I'm using notepad++ as my text editor and I want to set up a macro in there that can compile my programs for me.

I do not wish to install Cygwin though.

Any suggestions?

like image 902
hahuang65 Avatar asked Jun 06 '09 00:06

hahuang65


People also ask

Can you compile code without an IDE?

You can always build programs without the help of an IDE. You can even use Microsofts Visual Studio from the command line, and you won't see the GUI at all. Similar for XCode on Mac OS X. If you want to build a program without using any IDE, you basically write the source code the same way you do with IDE.

What happens if you program without an IDE?

You will not have a compiler that can point out syntax errors. You can't run the code, tweak it, and revise it until it works. You cannot run test cases against your code. You can't step through your code in a debugger.

Is there a built in C compiler in Windows?

Unfortunately, there is no in-built compiler.


3 Answers

MinGW. It's GCC/G++ for Windows. It's much lighter than Cygwin. The main difference from Cygwin GCC is that it doesn't try to emulate UNIX APIs, you have to use the Windows APIs (and of course the standard C/C++ libraries). It also doesn't provide a shell and utilities like Cygwin, just the compiler.

There is also a related system called MSYS, which provides a shell, etc. like Cygwin, but this is not required. MinGW itself will run in CMD (but I highly suggest using something better like Bash, for your own sanity).

like image 200
Zifre Avatar answered Sep 19 '22 18:09

Zifre


Visual C++ has a command line compiler, cl:

  • Compiler Command-Line Syntax (C++)
like image 26
Greg Hewgill Avatar answered Sep 19 '22 18:09

Greg Hewgill


If you don't have Visual Studio, you can download the Windows SDK (newer version) or the Windows Driver Kit for free, and then use the CL.EXE command-line compiler as suggested by @Greg Hewgill.

like image 26
Michael Ratanapintha Avatar answered Sep 23 '22 18:09

Michael Ratanapintha