15.04.2018 Views

programming-for-dummies

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Choosing a Compiler 89<br />

With a cross-compiler, you can write a program once and compile it to run on<br />

multiple operating systems, effectively doubling or tripling your potential market.<br />

Without a cross-compiler, you need to write a program <strong>for</strong> each compiler, under a<br />

different operating system, essentially doubling or tripling your work.<br />

Although the idea of writing a program once and having it run on multiple operating<br />

systems might seem appealing, cross-compilers aren’t perfect. Chances<br />

are good you’ll have to tweak your program to run under each operating<br />

system, but those minor tweaks can be much easier than rewriting huge<br />

chunks of your program if you had to use two separate compilers.<br />

Book I<br />

Chapter 4<br />

Programming Tools<br />

Cost<br />

Paying more <strong>for</strong> a compiler doesn’t necessarily mean you’re getting a better<br />

compiler. The GCC compiler is free and is one of the best compilers available.<br />

Generally, if you want to use a popular <strong>programming</strong> language, such as C++,<br />

you can find a free compiler, but if you want to use a more obscure <strong>programming</strong><br />

language, such as LISP or Modula-2, you’ll probably have to pay <strong>for</strong> a<br />

compiler.<br />

Because Windows is the most common operating system in the world, you can<br />

find plenty of free compilers. Some of these compilers are free only <strong>for</strong> personal<br />

use, but if you want to create programs to sell commercially, you have to pay<br />

<strong>for</strong> the compiler. Table 4-1 lists some popular free Windows compilers.<br />

Table 4-1<br />

Free Windows Compilers<br />

Compiler Name Programming Language Where to Find It<br />

GCC C, C++, Objective-C, Java, http://gcc.gnu.org<br />

FORTRAN, and Ada<br />

Visual Basic BASIC http://msdn.microsoft.<br />

Express 2005<br />

com/vstudio/express<br />

Visual C# Express 2005 C# http://msdn.microsoft.<br />

com/vstudio/express<br />

Visual C++ C++ http://msdn.microsoft.<br />

Express 2005<br />

com/vstudio/express<br />

Turbo C++ C++ www.turboexplorer.com<br />

Turbo C# C# www.turboexplorer.com<br />

Turbo Delphi Pascal www.turboexplorer.com<br />

Dev-C++ C++ www.bloodshed.net<br />

Dev-Pascal Pascal www.bloodshed.net<br />

Free Pascal Pascal www.freepascal.org<br />

Visual Prolog Prolog www.visual-prolog.com<br />

GNU Prolog Prolog http://gprolog.<br />

inria.fr

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!