| | |
Compiling Programs
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
Creating Executables
Of course, the software on your computer isn't all a bunch of code in a high level language, at least not in the form you receive it in. Before you can run any programs which are written in C++ or Java, they must be compiled. Compiling is the process by which a computer reads the code which you have written and interprets it. Usually, this is followed by the creation of an executable file. Executables are files which can be run by a user, like programs.
Compiling Your Code
To compile a program, you need to make use of a compiler. Each programming language available requires its own compiler to process the code. For example, one needs one of the many C++ compilers to process C++ code, similarly to how one needs a Java compiler to process Java code.
There are numerous compilers available, each one specific to a particular operating system and language. While free ones are available, they often prohibit the use of legally selling the software you create with them. It goes without saying that each compiler may have its own little quirks. For example, while trying to compile one of your programs, you may receive a simple warning when using one compiler. While using a different compiler, however, you may generate a programaming error, prohibiting your code from being compiled at all.
One of the most well known compilers for Windows machines is Microsoft Visual Studio 6.0, consisting of Visual C++ 6.0 and Visual J++ 6.0 (which can be purchased stand-alone as well). This program allows you to write software for Windows 9x/Me, NT, 2000, and XP.
Yet another very good compiler for Windows is made by Borland ... Borland C++ Builder and Borland JBuilder. They also offer free stripped-down C++ and Java compilers through their website.
Using A UNIX Compiler
Of course, the UNIX / Linux operating systems also make use of their own compilers. Compiling C++ on a UNIX box often involves the use of gcc, one of the original UNIX-based C++ compilers. This handy lil terminal-based program is commonly distributed with the operating system itself. To compile, simply type the following in a terminal:
Of course, the software on your computer isn't all a bunch of code in a high level language, at least not in the form you receive it in. Before you can run any programs which are written in C++ or Java, they must be compiled. Compiling is the process by which a computer reads the code which you have written and interprets it. Usually, this is followed by the creation of an executable file. Executables are files which can be run by a user, like programs.
Compiling Your Code
To compile a program, you need to make use of a compiler. Each programming language available requires its own compiler to process the code. For example, one needs one of the many C++ compilers to process C++ code, similarly to how one needs a Java compiler to process Java code.
There are numerous compilers available, each one specific to a particular operating system and language. While free ones are available, they often prohibit the use of legally selling the software you create with them. It goes without saying that each compiler may have its own little quirks. For example, while trying to compile one of your programs, you may receive a simple warning when using one compiler. While using a different compiler, however, you may generate a programaming error, prohibiting your code from being compiled at all.
One of the most well known compilers for Windows machines is Microsoft Visual Studio 6.0, consisting of Visual C++ 6.0 and Visual J++ 6.0 (which can be purchased stand-alone as well). This program allows you to write software for Windows 9x/Me, NT, 2000, and XP.
Yet another very good compiler for Windows is made by Borland ... Borland C++ Builder and Borland JBuilder. They also offer free stripped-down C++ and Java compilers through their website.
Using A UNIX Compiler
Of course, the UNIX / Linux operating systems also make use of their own compilers. Compiling C++ on a UNIX box often involves the use of gcc, one of the original UNIX-based C++ compilers. This handy lil terminal-based program is commonly distributed with the operating system itself. To compile, simply type the following in a terminal:
g++ file.C -o executable_nameOf course, your new executable file can then be run by typing ./executable_name. Note that file.C represents the original name of the C or C++ source code, and executable_name is the name of the location where you wish to put the new file to be created. If the file already exists, it will be overwritten automatically.
Last edited by cscgal; Aug 26th, 2004 at 3:00 pm.
If you are using OS X, the gcc compiler comes with the BSD subsystem. It's an optional component to install during OS X setup.
•
•
•
•
Originally Posted by cscgal
Creating Executables
Of course, the software on your computer isn't all a bunch of code in a high level language, at least not in the form you receive it in. Before you can run any programs which are written in C++ or Java, they must be compiled. Compiling is the process by which a computer reads the code which you have written and interprets it. Usually, this is followed by the creation of an executable file. Executables are files which can be run by a user, like programs.
Compiling Your Code
To compile a program, you need to make use of a compiler. Each programming language available requires its own compiler to process the code. For example, one needs one of the many C++ compilers to process C++ code, similarly to how one needs a Java compiler to process Java code.
There are numerous compilers available, each one specific to a particular operating system and language. While free ones are available, they often prohibit the use of legally selling the software you create with them. It goes without saying that each compiler may have its own little quirks. For example, while trying to compile one of your programs, you may receive a simple warning when using one compiler. While using a different compiler, however, you may generate a programaming error, prohibiting your code from being compiled at all.
One of the most well known compilers for Windows machines is Microsoft Visual Studio 6.0, consisting of Visual C++ 6.0 and Visual J++ 6.0 (which can be purchased stand-alone as well). This program allows you to write software for Windows 9x/Me, NT, 2000, and XP.
Yet another very good compiler for Windows is made by Borland ... Borland C++ Builder and Borland JBuilder. They also offer free stripped-down C++ and Java compilers through their website.
Using A UNIX Compiler
Of course, the UNIX / Linux operating systems also make use of their own compilers. Compiling C++ on a UNIX box often involves the use of gcc, one of the original UNIX-based C++ compilers. This handy lil terminal-based program is commonly distributed with the operating system itself. To compile, simply type the following in a terminal:
g++ file.C -o executable_nameOf course, your new executable file can then be run by typing ./executable_name. Note that file.C represents the original name of the C or C++ source code, and executable_name is the name of the location where you wish to put the new file to be created. If the file already exists, it will be overwritten automatically.
is it in it's fullest version?
Borland free C++ compiler i.e version 5.x does not come with and editor or and IDE.
But I heard they did release version 3.x compleately free along with the IDE.Go get that one if you can.
http://www.borland.com/
But I heard they did release version 3.x compleately free along with the IDE.Go get that one if you can.
http://www.borland.com/
![]() |
Similar Threads
- Visual C++ 08 Express compiling issues... (C++)
- compiling source for windows (Computer Science)
- what OS to use? (Getting Started and Choosing a Distro)
Other Threads in the C++ Forum
- Previous Thread: need Homework help
- Next Thread: C++ char array parsing-Help
| Thread Tools | Search this Thread |
api array based beginner binary c++ c/c++ calculator char char* class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news node numbertoword output parameter pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets







