Borna66
06-13-2010, 09:46 PM
با سلام
اين هم معرفي يیک کامپایلر خوب برای ++C كه توضيحات به زبان انگلسي روان هست كه روال نصب و كار با اين نرم افزار رو توضيح داده.
DevC++ For Windows
What is DevC++
DevC++ is a full-featured integrated development environment (IDE) that uses the MinGW version of C++. An IDE is a program that allows you to edit, compile, and debug your C++ programs without using the command-line. For those of you who prefer to use your own editor.
DevC++ comes with everything you need to compile and link both console-mode and GUI programs that will run on Windows 95/98/NT/2K/XP; your programs will not run on Windows 3.1 or on plain DOS machines however. You don't need to download and install anything else.
The rest of this page will walk you through the steps necessary to download, install, and run your C++ programs using DevC++ and the included version of the MinGW C++ compiler.
Step 1: Download DevC++
AClick the link below to download DevC++ 5 from www.download.com (http://pnu-club.com/redirector.php?url=http%3A%2F%2Fwww.download.com%2 F) :
دانلود این برنامه (حجم دانلود ۱۲ مگابایت ) :
http://www.download.com/3001-2069_4-1683220.html (http://pnu-club.com/redirector.php?url=http%3A%2F%2Fwww.download.com%2 F3001-2069_4-1683220.html)
CWhen the download dialog (below) appears, click Save,rather than Open:
http://pnu-club.com/imported/2010/06/60.gif
DSave the file in a download or temporary directory on your local machine. (Be sure to remember where you put it!).
http://pnu-club.com/imported/2010/06/61.gif
The downloaded file is about 12.5 MB; on a DSL connection it takes under 5 minutes to download. On a dial-up connection, though, downloading may take a while. In that case, you may want to copy the installation files from the Q: drive in the Computing Center, on to a CD or to a USB thumb-drive.
http://pnu-club.com/imported/2010/06/62.gif
Step 2: Install DevC++
AUsing Windows Explorer, locate the file you downloaded, check it's size to make sure that the download didn't stop prematurely, and then double-click it:
http://pnu-club.com/imported/2010/06/63.gif
BClick OK when the Welcome dialog appears, as shown here:
http://pnu-club.com/imported/2010/06/64.gif
CRead through the license and then click I Agree to install:
http://pnu-club.com/imported/2010/06/65.gif
DevC++ is released under the GNU Public License, (GPL), which allows you to obtain and modify the source code to the compiler and IDE. If you do so, then the changes you make must also be released under the GPL. However, the programs you create with MinGW don't normally link with GPL libraries, so you are free to distribute the programs you write using DevC++ and MinGW in any way you wish.
DSelect a folder where you would like to install DevC++. It's best if you don't use a folder that contains spaces, (such as "Documents and Settings"). As you can see here, I've created a folder named bin, where I install all of the programs that I use. Click Install once you've selected a folder:
http://pnu-club.com/imported/2010/06/66.gif
EHere's the dialog that is displayed while the files are decompressed and installed :
http://pnu-club.com/imported/2010/06/67.gif
FOnce the files are copied, click Close to finalize the installation:
http://pnu-club.com/imported/2010/06/68.gif
Step 3: Configure the IDE
The first time you use DevC++ you'll want to configure it to your use. (You'll need to do this the first time you use DevC++ in the Computing Center as well.)
ASelect the language and theme that you want to to use. Don't worry if you make a mistake, since you can modify your selection later:
http://pnu-club.com/imported/2010/06/69.gif
BConfigure the Environmental Options:
http://pnu-club.com/imported/2010/06/70.gif
Change to the Files & Dir tab, and then click the little button to the right of User's Default Directory text field. (You can't type directly in the field.)
http://pnu-club.com/imported/2010/06/71.gif
Locate the folder where you want to store your files. In the example shown here, I've selected the C:\docs\CS250 folder on my local machine. If you are working in the lab, create a CS250 folder on the U: drive. This is the folder where you'll store your files:
http://pnu-club.com/imported/2010/06/72.gif
CConfigure the Editor Options :
http://pnu-club.com/imported/2010/06/73.gif
Feel free to change whatever items you like. The only one that I really want is to have line numbers displayed. To do this, select the Display tab, and click the Line NUmbers checkbox, as shown here:
http://pnu-club.com/imported/2010/06/74.gif
DConfigure the Compiler Options :
http://pnu-club.com/imported/2010/06/75.gif
On the Compiler tab, add the following switches when calling the compiler:
-ansi -pedantic -Wall
Note that the W in Wall is capitalized, but everything else is lowercase. Here's what this tab should look like:
http://pnu-club.com/imported/2010/06/76.gif
On the Settings tab, choose Code Generation, and change Enable exception handling to Yes, as shown here:
http://pnu-club.com/imported/2010/06/77.gif
While still on the Settings tab, choose Linker and change Generate debugging information to Yes as shown here:
http://pnu-club.com/imported/2010/06/78.gif
Step 4 : Compile, Link, and Run
Here are the instructions to edit, compile, link, and run, a simple 3-file C++ project, based on a simple stock program from pages 416-419 in the C++ Primer Plus, 4th Edition.
ACreate a new project. You'll want to create a new project for every program, simply because it helps you to keep your files straight, and makes your life less confusing:
http://pnu-club.com/imported/2010/06/79.gif
Choose Empty Project from the New Project dialog. Provide a name, (HW01 in the shot shown here), and click OK:
http://pnu-club.com/imported/2010/06/80.gif
DevC++ will drop you in the folder you specified when you configured the Environmental Options in Step 3. Unlike Microsoft's Visual Studio, DevC++ doesn't automatically create a new folder for every project. Since you don't want all of your files in the same folder--especially in this class, where you'll create several different versions of the same files--you should Create a New Folder to store your project, as shown here:
http://pnu-club.com/imported/2010/06/81.gif
Navigate to the new folder, and save the project file (HW01.dev in the screenshot shown here:
http://pnu-club.com/imported/2010/06/82.gif
BCreate your source code files. Start by right-clicking the project in the Project tab, and then choosing New File as shown here:
http://pnu-club.com/imported/2010/06/83.gif
This creates an Untitled file. Click Save, (or press Control+S), and provide a name, as shown here:
http://pnu-club.com/imported/2010/06/84.gif
Repeat the project with each file in your project. Once you've created all of the files, you can type in the source code using the editor. The screenshot here shows the three source files in the project, after all of the code has been entered:
http://pnu-club.com/imported/2010/06/85.gif
CBuild the Project. DevC++ doesn't have separate Compile and Build settings, like some development environments. When you click the Compile button, (or press Control+F9), all of the C++ files in the project are compiled (if necessary), and the linker creates the executable program:
http://pnu-club.com/imported/2010/06/86.gif
As your program is being compiled, you'll see a progress dialog showing the individual steps:
http://pnu-club.com/imported/2010/06/87.gif
At the bottom of the screen, you'll also see a set of tabs that allow you to see the actual commands sent to the MinGW compiler, just as if you typed them from the command line:
http://pnu-club.com/imported/2010/06/88.gif
DRun the Program. To run the program, you can select the Run toolbar button, as shown here, or press Control+F10.
http://pnu-club.com/imported/2010/06/89.gif
Unfortunately, when you do that, the program opens a Command Prompt window, runs your program, and then immediately closes the window before you can examine the output.
To get the window to "stick around", you can add a command:
cin.get();
at the end of your main() function. If you do this, remember to remove the line before you submit your code, otherwise it won't run correctly.
A better solution, though, is to set a breakpoint at the end of your main() function, and then Debug the program instead of Running it. Simply click in the margin as shown here:
http://pnu-club.com/imported/2010/06/90.gif
Start the program by clicking the Debug toolbar button (shown here), or by pressing F10:
http://pnu-club.com/imported/2010/06/91.gif
A Command Prompt window will display the output of your program, and then stop on the breakpoint, leaving the command window open like this:
http://pnu-club.com/imported/2010/06/92.gif
To close the output window, choose the Debug tab at the bottom of the DevC++ IDE, and click on Continue. This will close the console window.
http://pnu-club.com/imported/2010/06/93.gif
اين هم معرفي يیک کامپایلر خوب برای ++C كه توضيحات به زبان انگلسي روان هست كه روال نصب و كار با اين نرم افزار رو توضيح داده.
DevC++ For Windows
What is DevC++
DevC++ is a full-featured integrated development environment (IDE) that uses the MinGW version of C++. An IDE is a program that allows you to edit, compile, and debug your C++ programs without using the command-line. For those of you who prefer to use your own editor.
DevC++ comes with everything you need to compile and link both console-mode and GUI programs that will run on Windows 95/98/NT/2K/XP; your programs will not run on Windows 3.1 or on plain DOS machines however. You don't need to download and install anything else.
The rest of this page will walk you through the steps necessary to download, install, and run your C++ programs using DevC++ and the included version of the MinGW C++ compiler.
Step 1: Download DevC++
AClick the link below to download DevC++ 5 from www.download.com (http://pnu-club.com/redirector.php?url=http%3A%2F%2Fwww.download.com%2 F) :
دانلود این برنامه (حجم دانلود ۱۲ مگابایت ) :
http://www.download.com/3001-2069_4-1683220.html (http://pnu-club.com/redirector.php?url=http%3A%2F%2Fwww.download.com%2 F3001-2069_4-1683220.html)
CWhen the download dialog (below) appears, click Save,rather than Open:
http://pnu-club.com/imported/2010/06/60.gif
DSave the file in a download or temporary directory on your local machine. (Be sure to remember where you put it!).
http://pnu-club.com/imported/2010/06/61.gif
The downloaded file is about 12.5 MB; on a DSL connection it takes under 5 minutes to download. On a dial-up connection, though, downloading may take a while. In that case, you may want to copy the installation files from the Q: drive in the Computing Center, on to a CD or to a USB thumb-drive.
http://pnu-club.com/imported/2010/06/62.gif
Step 2: Install DevC++
AUsing Windows Explorer, locate the file you downloaded, check it's size to make sure that the download didn't stop prematurely, and then double-click it:
http://pnu-club.com/imported/2010/06/63.gif
BClick OK when the Welcome dialog appears, as shown here:
http://pnu-club.com/imported/2010/06/64.gif
CRead through the license and then click I Agree to install:
http://pnu-club.com/imported/2010/06/65.gif
DevC++ is released under the GNU Public License, (GPL), which allows you to obtain and modify the source code to the compiler and IDE. If you do so, then the changes you make must also be released under the GPL. However, the programs you create with MinGW don't normally link with GPL libraries, so you are free to distribute the programs you write using DevC++ and MinGW in any way you wish.
DSelect a folder where you would like to install DevC++. It's best if you don't use a folder that contains spaces, (such as "Documents and Settings"). As you can see here, I've created a folder named bin, where I install all of the programs that I use. Click Install once you've selected a folder:
http://pnu-club.com/imported/2010/06/66.gif
EHere's the dialog that is displayed while the files are decompressed and installed :
http://pnu-club.com/imported/2010/06/67.gif
FOnce the files are copied, click Close to finalize the installation:
http://pnu-club.com/imported/2010/06/68.gif
Step 3: Configure the IDE
The first time you use DevC++ you'll want to configure it to your use. (You'll need to do this the first time you use DevC++ in the Computing Center as well.)
ASelect the language and theme that you want to to use. Don't worry if you make a mistake, since you can modify your selection later:
http://pnu-club.com/imported/2010/06/69.gif
BConfigure the Environmental Options:
http://pnu-club.com/imported/2010/06/70.gif
Change to the Files & Dir tab, and then click the little button to the right of User's Default Directory text field. (You can't type directly in the field.)
http://pnu-club.com/imported/2010/06/71.gif
Locate the folder where you want to store your files. In the example shown here, I've selected the C:\docs\CS250 folder on my local machine. If you are working in the lab, create a CS250 folder on the U: drive. This is the folder where you'll store your files:
http://pnu-club.com/imported/2010/06/72.gif
CConfigure the Editor Options :
http://pnu-club.com/imported/2010/06/73.gif
Feel free to change whatever items you like. The only one that I really want is to have line numbers displayed. To do this, select the Display tab, and click the Line NUmbers checkbox, as shown here:
http://pnu-club.com/imported/2010/06/74.gif
DConfigure the Compiler Options :
http://pnu-club.com/imported/2010/06/75.gif
On the Compiler tab, add the following switches when calling the compiler:
-ansi -pedantic -Wall
Note that the W in Wall is capitalized, but everything else is lowercase. Here's what this tab should look like:
http://pnu-club.com/imported/2010/06/76.gif
On the Settings tab, choose Code Generation, and change Enable exception handling to Yes, as shown here:
http://pnu-club.com/imported/2010/06/77.gif
While still on the Settings tab, choose Linker and change Generate debugging information to Yes as shown here:
http://pnu-club.com/imported/2010/06/78.gif
Step 4 : Compile, Link, and Run
Here are the instructions to edit, compile, link, and run, a simple 3-file C++ project, based on a simple stock program from pages 416-419 in the C++ Primer Plus, 4th Edition.
ACreate a new project. You'll want to create a new project for every program, simply because it helps you to keep your files straight, and makes your life less confusing:
http://pnu-club.com/imported/2010/06/79.gif
Choose Empty Project from the New Project dialog. Provide a name, (HW01 in the shot shown here), and click OK:
http://pnu-club.com/imported/2010/06/80.gif
DevC++ will drop you in the folder you specified when you configured the Environmental Options in Step 3. Unlike Microsoft's Visual Studio, DevC++ doesn't automatically create a new folder for every project. Since you don't want all of your files in the same folder--especially in this class, where you'll create several different versions of the same files--you should Create a New Folder to store your project, as shown here:
http://pnu-club.com/imported/2010/06/81.gif
Navigate to the new folder, and save the project file (HW01.dev in the screenshot shown here:
http://pnu-club.com/imported/2010/06/82.gif
BCreate your source code files. Start by right-clicking the project in the Project tab, and then choosing New File as shown here:
http://pnu-club.com/imported/2010/06/83.gif
This creates an Untitled file. Click Save, (or press Control+S), and provide a name, as shown here:
http://pnu-club.com/imported/2010/06/84.gif
Repeat the project with each file in your project. Once you've created all of the files, you can type in the source code using the editor. The screenshot here shows the three source files in the project, after all of the code has been entered:
http://pnu-club.com/imported/2010/06/85.gif
CBuild the Project. DevC++ doesn't have separate Compile and Build settings, like some development environments. When you click the Compile button, (or press Control+F9), all of the C++ files in the project are compiled (if necessary), and the linker creates the executable program:
http://pnu-club.com/imported/2010/06/86.gif
As your program is being compiled, you'll see a progress dialog showing the individual steps:
http://pnu-club.com/imported/2010/06/87.gif
At the bottom of the screen, you'll also see a set of tabs that allow you to see the actual commands sent to the MinGW compiler, just as if you typed them from the command line:
http://pnu-club.com/imported/2010/06/88.gif
DRun the Program. To run the program, you can select the Run toolbar button, as shown here, or press Control+F10.
http://pnu-club.com/imported/2010/06/89.gif
Unfortunately, when you do that, the program opens a Command Prompt window, runs your program, and then immediately closes the window before you can examine the output.
To get the window to "stick around", you can add a command:
cin.get();
at the end of your main() function. If you do this, remember to remove the line before you submit your code, otherwise it won't run correctly.
A better solution, though, is to set a breakpoint at the end of your main() function, and then Debug the program instead of Running it. Simply click in the margin as shown here:
http://pnu-club.com/imported/2010/06/90.gif
Start the program by clicking the Debug toolbar button (shown here), or by pressing F10:
http://pnu-club.com/imported/2010/06/91.gif
A Command Prompt window will display the output of your program, and then stop on the breakpoint, leaving the command window open like this:
http://pnu-club.com/imported/2010/06/92.gif
To close the output window, choose the Debug tab at the bottom of the DevC++ IDE, and click on Continue. This will close the console window.
http://pnu-club.com/imported/2010/06/93.gif