Hi,
I am a new member and new to C++. I would like to know which is the preferred compiler to use during the learning process. At the moment I am using Open Watcom and, although quite experienced in cross compilers in terms of linkers/assemblers/makefiles etc, is there something like Turbo C++ out there?
I have noticed on the forums that Delphi seems to be used quite a lot!
One of my main problems with Watcom is that whilst I am going through the tutorials I keep having to create numerous projects in order to do the examples and save them etc.
Any help would be gratefully appreciated.
Regards,
Gerald.
If you want to compile single file programs without having to create a project, then I'd say the way to go is to get Notepad++ to write your code and GCC (UNIX) or MinGW (Windows) to compile. Then you can just do g++ program.cpp -o program
and that will compile, assemble, and link the executable.
Compiling with optimizations would be g++ program.cpp -o program -O3 -s (-O3 means "full optimization"; -s means "strip symbols" [reduces file size])
Debugging is an entirely different thing, though. This method works best when you're just trying things and can tell if something's going wrong from just the behavior of the program. If you need to debug, an IDE will be much easier.
I suggest very deeply that you not use VC++ only because it's Operating System based. It's only for Windows and Windows only. You may use something like MinGW (not cygwin) which is a port of GCC, Intel compiler, and tons others.
Anything compiled in Visual C++ isn't neccessarily operating system based but it makes it difficult for everyone else to support cross-platform capabilities.
For quick single-file programs and compilation with mingw/gcc, I find Dev-C++ handy. You don't need to create a "project". Just select "new source file", put in the code, and hit F9. It would be nice if the console would automatically stay open, though, like in CodeBlocks.
Dev-C++ and Eclipse are NOT compilers. They are called IDEs. An IDE stands for Integrated Development Environment. They are simply tools to ease the programmer the pain of configuring a compiler as well as giving you tools to help you code such as a built in text editor.
An example of a compiler is such as GCC, VC++ (Visual C++), Tiny C Compiler (C only), Intel C++ compiler, Borland C++ (IDE too? Never used Borland).
Dev-C++ actually uses GCC or more specifically MinGW which is a port of GCC to Windows. Eclipse also uses MinGW. I use MinGW directly through command prompt sometimes for simplicity but I also use it through Code::Blocks (IDE) and I use GCC directly on Linux. I suggest Code::Blocks for large flexibility and ease of use. Though it can be difficult to setup (correctly at least) it becomes a powerful tool with the ability to use over 10 compilers that are the most popular compilers to date.
Though there are plenty of tutorials, if you want I can post up a tutorial here on the forums on how to setup a couple of compilers.
To jloundy:
I've installed and tried vc, ( took a while ), and it appears to be just what I needed so thank you very much.
To helios:
I'm a great supporter of GNU and have worked on embedded Linux a few times and so am very used to the cc compilers but thanks anyway.
To computerquip:
I fully appreciate your concerns as to cross compilation/platforms having been writing code for microprocessor target systems most of my career - see my profile. But all I wanted at this stage was a quick way to get into C++ and vc seems to provide. Here's some nostalgia;
Many years ago I learned C, ( using Kernigan & Richie book ), on a DEC PDP11 using 12 inch floppy drives and huge tapes, ha, ha! There's hope for me yet!
As for 'true' compilers I chose Watcom for the fact that it is a fully fledged compiler with full access to the assembler and linker which makes it a very useful tool indeed. In fact, once I'm up to speed with C++, I will be returning to it in due time. Of recent, ( digital set-top box design ), I used the Microtc Cross compiler for Motorola - they now do an Intel version for 80x platforms.
To Hammurabi:
I actually meant Dev-C++. I will look at that but I am happy with vc - thanks anyway.
Once again thanks all for your help. I'm sure - in fact positive - that I'll be asking a lot more questions on this forum and one day soon I will be able to help others.
Personally, I fill that MinGW is more convenient than VC++ in setup but that's probably because that's what I've worked with for 6 months now. As a matter of fact, Code::Blocks IDE comes with a binary setup with MinGW already setup as well as Eclipse and Dev-C++.
I will say however VC++ has GREAT documentation for errors that pop up. I don't like how the compiler itself takes arguments and how it's arranged. Very difficult to do by Console.