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

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
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?

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).

Visual C++ has a command line compiler, cl:
Compiler Command-Line Syntax (C++)

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.

Digital Mars is excellent.

Probably not what you're looking for, but just to add to the question for completeness, the Intel Optimizing Compiler works great on Windows, Linux and Mac Intel platforms. A bit on the pricey side, but for highly optimized compiles on Intel processors it's second to none.

I think that the TDM-GCC from Twilight Dragon Media is more convenient than the official MinGW release. I found it simpler to install and use.

The old Borland C++ non-IDE compiler is freely available:
http://cc.codegear.com/Free.aspx?id=24778
Here is Wikipedia's background on this free, Windows, command-line compiler:
http://en.wikipedia.org/wiki/Borland_C%2B%2B

With Windows 10, you can use g++ via the Windows Linux Subsystem.
Once you've set it up, install g++ using the bash terminal (this answer on Ask Ubuntu shows you how).
Bear in mind: you will only be able to run compiled C++ programs in the Ubuntu/bash environment, not from cmd/PowerShell directly:
C:\Folder> bash
User#Computer:/mnt/c/Folder$ g++ hello_world.cpp -o hello_world
User#Computer:/mnt/c/Folder$ ./hello_world

Related

What is the use of Cygwin exactly? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I installed Cygwin on my laptop. After going through the instructions on netbeans site, i found that i need to change the path directory.
My path directory initially shows some java thing on that and if i change it then will it create some problem?
I basically Want to run C/C++ programs by NetBeans so I installed Cygwin thinking that it would help me.
Please Suggest me what to do.
Took this from the original guide
Cygwin is a Linux-like environment for Windows. It consists of a DLL
(cygwin1.dll), which acts as an emulation layer providing substantial
POSIX (Portable Operating System Interface) system call functionality,
and a collection of tools, which provide a Linux look and feel. The
Cygwin DLL works with all x86 and AMD64 versions of Windows NT since
Windows XP SP3. The API follows the Single Unix Specification as much
as possible, and then Linux practice. The major differences between
Cygwin and Linux is the C library (newlib instead of glibc). With
Cygwin installed, users have access to many standard UNIX utilities.
They can be used from one of the provided shells such as bash or from
the Windows Command Prompt. Additionally, programmers may write Win32
console or GUI applications that make use of the standard Microsoft
Win32 API and/or the Cygwin API. As a result, it is possible to easily
port many significant UNIX programs without the need for extensive
changes to the source code. This includes configuring and building
most of the available GNU software (including the development tools
included with the Cygwin distribution).

Cross-Compiling C++/QT from a Mac for WIndows, Linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I developed a C++/QT application and I am trying to compile it for Mac, Windows and Linux. I chose C++ just so I can make it compatible with these major operating systems. I can compile it for mac just fine.
I found out about Cross Compiling but some are outdated or not well documented... or does not guarantee they will work on the latest version of Windows or a Mac.
I do have Virtual Windows and Cent OS installed on my machine but I feel that compiling the application manually would be over kill.
So, do you recommend any reliable cross-compiler? Or is there any way to automate the compilation so if I have to, it can compile by logging on to my Virtual Windows or Cent OS installations?
FYI... not only cross compile but also generate 32 bit and 64 bit versions!
For Mac and linux you don't have a big issue here if you got the g++ compiler installed in your OS. But you will need to install Mingw or cygwin in the Windows installation to provide the gcc and the g++ compilers for your programs and if you want to automate your compilation process you can use a Makefile or try to see the autotools.
The only cross compiler that I know of is GCC. I have actually used it on Linux to cross-compile for S/390 a while back, and also to cross-compile ARM code on a Power Mac (I used the instructions here to set it up).
That said, I think that what you want is to cross-compile Windows x64 on a 32 bit virtual machine running Windows. If that is the case you are lucky, because Microsoft actually gives away the cross compilers for free with the Windows SDK since Windows 2000 SDK. I actually use the Windows Vista SDK (ver 6.1) on Virtual PC running XP to compile for Windows x64. Here you can download the latest version of the SDK, which comes with the compilers. I looked on the system requirements and it still supports XP, so this should be good for you.
Please note that the compilers are the same that come with Visual Studio, but you will have to invoke them from the command line environment installed by the SDK by either using 'cl' or 'nmake'.
You can chose the compilation mode by issuing SETENV /x86 for 32 bit or SETENV /x64 for 64 bits -there is another mode for Itanium but I have never used it-. The Visual Studio IDE is not included because it is a paid product, but good quality compilers for free is a good enough to anyone.

Free C/C++ IDE for Windows 7 that works with GCC [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I've learned C and C++ in Borland's Turbo C++ IDE, the 16-Bit version with that old blue screen background, in which I started off building console programs for Windows. Now that Windows Vista and 7 doesn't support that IDE to be run in full-screen mode, I'm looking for such similar IDE (not necessarily from Borland), that comes with GCC, and doesn't need much learning to use if one has already worked with Turbo C. So is there any free GCC IDE that works with Windows 7? I'll not be using it for developing Windows applications, since I need it to practice on data structure console programs.
Turbo C++ is very old, and the concepts and philosophies of IDE design as (as well as the language C++ compilers are compiling) have developed much further since.
You might try Code::Blocks or Eclipse, but I wouldn't expect a transition as smooth as going to the next version of Turbo C++. (Which weren't as smooth either, BTW. The latest of that series, BCC 5.0 was quite different to the old DOS TC environments, and even that got abandoned later in favor of the very different C++ Builder IDE.)
BTW, does it have to be GCC? Visual C++ Express is free also, the VC compiler isn't worse than GCC, and the IDE is quite good.
There are a few C++ IDEs with many features.
Bloodshed Dev C++
NetBeans C
C++ IDE
Eclipse CDT
CodeBlocks
Also take a look at Cygwin which provides a linux like environment for Windows. If you are making console applications, using a good shell won't hurt.
An open source IDE that runs on Windows that should get more mention than it currently does is QtCreator. While it's tailored to working with the Qt framework, it works just fine for non-Qt-based C++ work (though you won't get much help in the form of UI wizards unless you're using Qt for the UI).
It's much lighter than Eclipse/CDT and I find it easier to use (though I normally use Visual Studio over either QtCreator or Eclipse/CDT).
General information/marketing for QtCreator: http://qt.nokia.com/products/developer-tools/developer-tools
Nokia provides a Windows package that includes the MinGW GCC compiler. Go to the download page and select the "Qt Creator 2.1 Binary for Windows" link (I have no idea why Nokia doesn't link to the download from the info page): http://qt.nokia.com/downloads
Of course if you just want a free C++ IDE for Windows, and don't really care if it's GCC or MSVC based, I'd suggest getting VC++ Express: http://www.microsoft.com/express/Windows/
If you're looking for a beer-free IDE, just download Visual Studio Express from Microsoft - it's not gcc behind the covers but it is tuned very well for Windows.
If you're after a speech-free one, Code::Blocks is the best I've ever seen. The larger setup package for Windows includes the backing gcc compiler and gdb debugger.
You can use codeblocks: http://www.codeblocks.org/
It is not a console IDE but you can build console programs and watch the output in a window.
The best solution if you are using windows is CODEBLOCKS-EP(Education Portal).
You can find it at http://codeblocks.codecutter.org/
Once you find it, I would personally recommend the "Zip (CodeBlocks-EP.zip)" file download.
Hope this helps.
Happy Coding
I can suggest you Eclipse ID with CDT (you can download bundle from http://eclipse.org) + MinGW compiler tool. Or You can use the Code::Blocks IDE.
I like Bloodshed Dev-C++, but I don't know if it runs on W7.
I suggest using CodeLite opensource cross platform IDE for the C/C++ programming languages:
It works great on almost all Operating Systems
Windows XP/7 and 8
Debian / Ubuntu
Fedora / OpenSUSE
Mac OSX 10.5.8
http://codelite.org/

Alternative C++ Compilers? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
I want to start learning C++, so I downloaded Microsoft Visual Studio 2010 Express, and the entire application freezes and crashes every time I try to compile (debug and release build) something (I have tried running it in Admin Mode). Is there a good alternative compiler that I could still use VS 2010 as the IDE?
I am not sure why it crashes for you. But there are lots of C++ compilers out there.
http://en.wikipedia.org/wiki/List_of_compilers#C.2FC.2B.2B_compilers
And there is a thread below to use GCC with Visual Studio
GCC with Visual Studio?
if its crashing, I would think its more likely the ide is crashing, not the compiler.
you can use the compiler from the command line as per http://msdn.microsoft.com/en-us/library/ms235639(VS.80).aspx
How about bloodshed dev-cpp. It supports cygwin and mingw.
NO! There is no other compiler that plugs into VS2010 or VS anything else. Each version of VS is tightly tied to its corresponding version of the Microsoft compiler.
As an alternative, how about:
VirtualBox
Linux
g++, perhaps enhanced with Eclipse / C++ for an IDE.
Cost: $0.
Eclipse for C++
If you want something with IDE, I would suggest g++, Eclipse and CDT plugins. Works quite well.
You can use g++ on command line if you are comfortable that way.

Is there a good tool for Makefile generation? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I'm looking for a tool which can generate a Makefile for a C/C++ project for different compilers (GCC, Microsoft Visual C++, C++Builder, etc.) and different platforms (Windows, Linux, and Mac).
Other suggestions you may want to consider:
Scons is a cross-platform, cross-compiler build library, uses Python scripting for the build systems. Used in a variety of large projects, and performs very well.
If you're using Qt, QMake is a nice build system too.
CMake is also pretty sweet.
Finally, if all else fails...
Try Automatic Makefile Generator.
It has support for the following compilers:
Borland 3.1
Borland 5.0
Borland 5.0, 16 bit
Borland 5.5
Borland 5.6
Borland 5.8
CC
GNU g++
GNU g++, dynamic library
Intel 5, 6, 7 for Linux
Intel 5, 6, 7 for Linux, dynamic library
Intel 5, 6, 7 for Windows
Intel 8,9,10 for Linux
Intel 8,9,10 for Linux, dynamic library
Intel 8,9 for Windows
Intel 10 for Windows
Visual C++ 5
Visual C++ 6, 7, 7.1
Visual C++ 8
Open Watcom
Watcom 10A
Watcom 10A, 16 bit
I've used Bakefile before with some success. It's fairly simple and seems to work well.
CMake is the only tool which can actually generate real Visual Studio projects (i.e., not "Makefile"-projects which call out to an external tool), and which automatically recreates the projects when the build input file (CMakeLists.txt) changes.
SCons performance issues are well-known and a thoroughly debated topic on the SCons mailing lists.
I would vote for OMake. It fixes all complains I had with GNU make:
it's a full-blown language.
uses MD5 instead of timestamps.
provides a minimal shell which implements the most useful Unix commands on all platforms: find, sed, AWK, etc.
works with either Unix or DOS style pathnames.
extensively documented.
supports parallel builds.
fast.
I'll also second CMake. I've been using it for quite a while on a multi-platform project and I'm very satisfied with it.
Automatic generation of (M|m)akefiles makes me worry about what you're trying to do here.
Do you understand what goes on under the covers when you type make? Or gmake? I'm only asking because if you don't when things break, such as new code changes not being incorporated into the build, you'll have difficulties trying to work what has happened.
To start to understand make, can I suggest having a read of "Managing Projects with GNU Make" by Robert Mecklenberg. The early chapters cover how make is working. Getting your heard around the fact that make is backward chaining is one of the biggest things you can do.
If you don't, and your system appears to work, then you'll be, to use The Pragmatic Programmers' term, "programming by coincidence". (-:
BTW Great articles available at their site! And I'm not involved with them. YMMV. Yada-yada...
One issue to consider is do you want a "makefile" creator or a replacement build system? The problem with replacement build systems is that you typically don't get good IDE integration for platforms whose users expect this (Visual C++).
If you do want a makefile creator instead of a replacement build system, take a look at MPC. It's free and open source.
A recent addition to the list of make replacements is waf. From personal experience, SCons does the job pretty well.
I am working on a similar Makefile auto-generator projection called CodeMate, developed by using Ruby. Maybe it is not that mature for large applications right now, but I will keep working on it to make it better.
Users should not need to edit any configuration file to build the software, or at least it is supposed to be. The learning curve should be minimized.