Instructions for downloading and installing Code::Blocks v10...

22
1 Instructions for downloading and installing Code::Blocks v10.05 (Mac version) If you have trouble, contact your instructor. It will be helpful to note which page of these instructions you were on when you had problems. Note that you need to install Mac's XCode tools first! Then you need to download the software onto your Mac. In your browser, go to the following URL: http://prdownload.berlios.de/codeblocks/codeblocks-10.05-p1-mac.dmg and click on one of the links to download the software. created by Prof Elizabeth Sklar (5-sep-2010). Send comments/corrections to: [email protected]

Transcript of Instructions for downloading and installing Code::Blocks v10...

Page 1: Instructions for downloading and installing Code::Blocks v10 ...sklar/cisc1110/codeblocks...Instructions for downloading and installing Code::Blocks v10.05 (Mac version) If you have

1

Instructions for downloading andinstalling Code::Blocks v10.05

(Mac version)

If you have trouble, contact your instructor. It will behelpful to note which page of these instructions youwere on when you had problems.

Note that you need to install Mac's XCode tools first!Then you need to download the software onto your Mac.In your browser, go to the following URL: http://prdownload.berlios.de/codeblocks/codeblocks-10.05-p1-mac.dmg

and click on one of the links to download the software.

created by Prof Elizabeth Sklar (5-sep-2010). Send comments/corrections to: [email protected]

Page 2: Instructions for downloading and installing Code::Blocks v10 ...sklar/cisc1110/codeblocks...Instructions for downloading and installing Code::Blocks v10.05 (Mac version) If you have

2

The screen below shows the downloading process.I clicked on the second link (the line starting with“download2”…).

Page 3: Instructions for downloading and installing Code::Blocks v10 ...sklar/cisc1110/codeblocks...Instructions for downloading and installing Code::Blocks v10.05 (Mac version) If you have

3

When the software has finished downloading, aCodeBlocks window should open, as below.

Page 4: Instructions for downloading and installing Code::Blocks v10 ...sklar/cisc1110/codeblocks...Instructions for downloading and installing Code::Blocks v10.05 (Mac version) If you have

4

Select Go…Applications from the Finder menu, whichwill open a window displaying your Applications folder.

Page 5: Instructions for downloading and installing Code::Blocks v10 ...sklar/cisc1110/codeblocks...Instructions for downloading and installing Code::Blocks v10.05 (Mac version) If you have

5

Drag the CodeBlocks icon into your Applications folder.You will probably see a window that says CopyingCodeBlocks to Applications show up for a short time.

Page 6: Instructions for downloading and installing Code::Blocks v10 ...sklar/cisc1110/codeblocks...Instructions for downloading and installing Code::Blocks v10.05 (Mac version) If you have

6

For reference, you may want to copy the other files fromthe CodeBlocks installation onto your Desktop or yourApplications folder (CodeBlocks.pdf, COPYING andReadMe.rtf). CodeBlocks.pdf is the user's manual, soyou may find that file especially helpful.

Page 7: Instructions for downloading and installing Code::Blocks v10 ...sklar/cisc1110/codeblocks...Instructions for downloading and installing Code::Blocks v10.05 (Mac version) If you have

7

To start up Code::Blocks, find the CodeBlocks icon inyour Applications folder. Double-click on it.

Page 8: Instructions for downloading and installing Code::Blocks v10 ...sklar/cisc1110/codeblocks...Instructions for downloading and installing Code::Blocks v10.05 (Mac version) If you have

8

The first time you start up Code::Blocks, you may seethe splash screen displayed for a while. Just be patient…

Page 9: Instructions for downloading and installing Code::Blocks v10 ...sklar/cisc1110/codeblocks...Instructions for downloading and installing Code::Blocks v10.05 (Mac version) If you have

9

Code::Blocks will open two windows. You can close theScripting console.

Page 10: Instructions for downloading and installing Code::Blocks v10 ...sklar/cisc1110/codeblocks...Instructions for downloading and installing Code::Blocks v10.05 (Mac version) If you have

10

Now you are finally ready to create your first program inCode::Blocks!

Page 11: Instructions for downloading and installing Code::Blocks v10 ...sklar/cisc1110/codeblocks...Instructions for downloading and installing Code::Blocks v10.05 (Mac version) If you have

11

Start by selecting File...New…Empty File from thepulldown menu at the top of the screen.

Page 12: Instructions for downloading and installing Code::Blocks v10 ...sklar/cisc1110/codeblocks...Instructions for downloading and installing Code::Blocks v10.05 (Mac version) If you have

12

The editor where you will type your C++ program isshown below. I put a pink arrow on the image to showyou where to type.

Page 13: Instructions for downloading and installing Code::Blocks v10 ...sklar/cisc1110/codeblocks...Instructions for downloading and installing Code::Blocks v10.05 (Mac version) If you have

13

Type the code for the “hello world” program in the editorwindow, like we did in class. Note that every time youpress the Enter key, a new line and line number appear.

Page 14: Instructions for downloading and installing Code::Blocks v10 ...sklar/cisc1110/codeblocks...Instructions for downloading and installing Code::Blocks v10.05 (Mac version) If you have

14

When you are done typing, select File…Save File As…from the menu. The Save File window appears. Typehello.cpp in the Save As: box, then click on Save.

Page 15: Instructions for downloading and installing Code::Blocks v10 ...sklar/cisc1110/codeblocks...Instructions for downloading and installing Code::Blocks v10.05 (Mac version) If you have

15

Notice that after you have saved the file as a .cpp file,the editor will display the text you typed in color. This iscalled “syntax highlighting”. It can help you be careful.

Page 16: Instructions for downloading and installing Code::Blocks v10 ...sklar/cisc1110/codeblocks...Instructions for downloading and installing Code::Blocks v10.05 (Mac version) If you have

16

Now it is time to compile your code, to translate it fromthe language you can read into a language that thecomputer can run. Select Build…Build from the menu.

Page 17: Instructions for downloading and installing Code::Blocks v10 ...sklar/cisc1110/codeblocks...Instructions for downloading and installing Code::Blocks v10.05 (Mac version) If you have

17

Check the Build log window at the bottom of the screen.You should have 0 errors and 0 warnings.

Page 18: Instructions for downloading and installing Code::Blocks v10 ...sklar/cisc1110/codeblocks...Instructions for downloading and installing Code::Blocks v10.05 (Mac version) If you have

18

If your file compiled with 0 errors and 0 warnings, thenyou are ready to run your program. Select Build…Runfrom the menu.

Page 19: Instructions for downloading and installing Code::Blocks v10 ...sklar/cisc1110/codeblocks...Instructions for downloading and installing Code::Blocks v10.05 (Mac version) If you have

19

Code::Blocks will open a Terminal window and run yourprogram, as below. Your output hello world! isdisplayed. You can close the terminal window.

Page 20: Instructions for downloading and installing Code::Blocks v10 ...sklar/cisc1110/codeblocks...Instructions for downloading and installing Code::Blocks v10.05 (Mac version) If you have

20

Troubleshooting

• If you have problems compiling (you don’t get 0 errorsand 0 warnings), then check your code carefully. Makesure that it is exactly as I gave it to you in class. Makesure that the punctuation marks are all the same.Make sure that the letters are all lower-case.

• If you have problems with Code::Blocks recognizingyour compiler, then make sure that your setup iscorrect. Note that you should have installed Apple'sXCode Tools prior to installing Code::Blocks. XCodecomes with Mac OS X as an optional application onthe installation disks. You can also download it forfree from the Apple web site.

Page 21: Instructions for downloading and installing Code::Blocks v10 ...sklar/cisc1110/codeblocks...Instructions for downloading and installing Code::Blocks v10.05 (Mac version) If you have

21

To make sure that the compiler is installed correctly,select Settings…Compiler and debugger from themenu.

Page 22: Instructions for downloading and installing Code::Blocks v10 ...sklar/cisc1110/codeblocks...Instructions for downloading and installing Code::Blocks v10.05 (Mac version) If you have

22

Select the Toolchain executables tab. The windowbelow should be displayed. Make sure that the fields arefilled in as below. If not, your installation was incorrect.