1 INF160 IS Development Environments AUBG, COS dept Lecture 06 Title: Dev Env: Code::Blocks (Extract from Syllabus) Reference: www.codeblocks.org.

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

Using Eclipse. Getting Started There are three ways to create a Java project: 1:Select File > New > Project, 2 Select the arrow of the button in the upper.
 2006 Pearson Education, Inc. All rights reserved Introduction to the Visual C# 2005 Express Edition IDE.
E.1 Eclipse. e.2 Installing Eclipse Download the eclipse.installation.exe from the course web site to your computer and execute it. Keep the destination.
Eclipse Introduction Dwight Deugo Nesa Matic
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Using the File Manager WebCT 6. Understanding File Manager The File Manager is the area where all course files are stored. Whenever you link a file in.
Using Visual C++ and Pelles C
Eclipse IDE. 2 IDE Overview An IDE is an Interactive Development Environment Different IDEs meet different needs BlueJ and DrJava are designed as teaching.
03 Using Eclipse. 2 IDE Overview An IDE is an Interactive Development Environment Different IDEs meet different needs BlueJ and DrJava are designed as.
Creating a Console Application with Visual Studio
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
Digital Image Processing Lecture3: Introduction to MATLAB.
1 ENG236: ENG236: C++ Programming Environment (2) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.
A First Program Using C#
COS120 Software Development Using C++ AUBG Fall semester 2010 Ref book: Problem Solving, Abstraction and Design Using C++ Authors: Frank Friedman, Elliot.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 2 - Welcome Application: Introduction to C++
Programming with Microsoft Visual Basic 2012 Chapter 12: Web Applications.
Computer Programming and Basic Software Engineering 9 Building Graphical User Interface Working with Unmanaged Code.
Computing IV Visual C Introduction with OpenCV Example Xinwen Fu.
IT 211 Project Integration and Deployment Lab #11.
CS Tutorial 1 Getting Started with Visual Studio 2012 (Visual Studio 2010 are no longer available on MSDNAA, please choose Visual Studio 2012 which.
Visual Studio.NET Part 2 dbg --- Using the VS.NET Integrated Development Environment.
1 Development Environments AUBG, COS dept Lecture Title: Dev Env: Eclipse (Extract from Syllabus) Reference:
Lecture Set 1 Part C: Understanding Visual Studio and.NET – Applications, Solutions, Projects (no longer used – embedded in Lecture Set 2A)
Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.
Visual Studio.NET Part 2 dbg --- Using the Integrated Development Environment.
Introduction to the Visual Studio.NET IDE (LAB 1 )
Introduction to Eclipse CSC 216 Lecture 3 Ed Gehringer Using (with permission) slides developed by— Dwight Deugo Nesa Matic
1 INF160 IS Development Environments AUBG, COS dept Lecture 06 Title: Dev Env: Visual Studio (Extract from Syllabus) Reference:
Lecture 6: Computer Languages. Programming Environments (IDE) COS120 Software Development Using C++ AUBG, COS dept.
Tutorial 11 Five windows included in the Visual Basic Startup Screen Main Form Toolbox Project Explorer (Project) Properties.
Active-HDL Interfaces Debugging C Code Course 10.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files.
(for Visual C++) Created by Daniel Lee, Li Mengran (past tutors) Contributions: Loke Yan Hao (current tutor)
9/2/ CS171 -Math & Computer Science Department at Emory University.
1 INF160 IS Development Environments AUBG, COS dept, Fall semester 2011 Reference books: Baltzan Paige, Business Driven Information Systems, McGraw- Hill/Irwin,
Lecture 15: Control Flow (cont). 2 Lecture Contents: t Design and implementation of programs illustrating linear algorithms, branch algorithms and loop.
Using Microsoft Visual Studio 2005 Original by Suma Rao Revised by John G. McMahon ( 9/6/2008 )
Java Classes. Consider this simplistic class public class ProjInfo {ProjInfo() {System.out.println("This program computes factorial of number"); System.out.println("passed.
Microsoft Outlook 2010 Chapter 3 Managing Contacts and Personal Contact Information with Outlook.
1 Chapter Nine Using GUI Objects and the Visual Studio IDE.
 2006 Pearson Education, Inc. All rights reserved Introduction to the Visual C# 2005 Express Edition IDE.
Programming with Visual Studio.NET A short review of the process.
Liferay Installation Prepared by: Do Xuan Hai 8 August 2011.
Microsoft Visual Basic 2005 BASICS Lesson 1 A First Look at Microsoft Visual Basic.
Slide 1 Using Menu Bar & Common Dialog Boxes. Slide 2 Setting Up the Main Items v First open the form on which you want the menu located v Then start.
C++ LANGUAGE TUTORIAL LESSON 1 –WRITING YOUR FIRST PROGRAM.
A STEP-BY-STEP GUIDE FOR NAVIGATING AROUND THE HOME PANE COMPOSING & SENDING MESSAGES REPLYING TO MESSAGES ATTACHING FILES DELETING MESSAGES PRINTING MESSAGES.
Cs423-cotter1 Windows Operating Environment. cs423-cotter2 Windows Operating Environment 32 bit operating environment – Windows XP Microsoft Visual Studio.net,.net2005,
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files 8/10/ :35 PM.
Open project in Microsoft Visual Studio → build program in “Release” mode.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Customizing Menus and Toolbars CHAPTER 12 Customizing Menus and Toolbars.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
1 Development Environments AUBG, COS dept Lecture Title: Dev Env: NetBeans (Extract from Syllabus) Reference:
Tutorial 1 Writing Your First C++ Program CSC1110C Introduction to Computer Programming By Paul Pun Acknowledgement: Special thanks to Dr. Michael Fung.
DEVRY CIS 170 C I L AB 1 OF 7 G ETTING S TARTED Check this A+ tutorial guideline at
Development Environment Setup
Running Programs & IDEs Reference: COS240 Syllabus
Introduction to the Visual C# 2005 Express Edition IDE
Module 6: Creating Web Pages and Working with Channels
Lab 1 Introduction to C++.
1. Open Visual Studio 2008.
Welcome to Intro to C/C++ CISC 192
Lab 1 Introduction to C++.
Welcome to Intro to C/C++ CISC 192
Presentation transcript:

1 INF160 IS Development Environments AUBG, COS dept Lecture 06 Title: Dev Env: Code::Blocks (Extract from Syllabus) Reference:

2 Lecture Contents: §Code::Blocks – introduction §Code::Blocks – functionality §Code::Blocks – configuration

3 Code::Blocks – introduction §Code::Blocks: The open source, cross platform, free C, C++ and Fortran IDE. §Code::Blocks is a free C, C++ and Fortran IDE built to meet the most demanding needs of its users. §Built around a plugin framework, Code::Blocks can be extended with plugins. Any kind of functionality can be added by installing/coding a plugin. For instance, compiling and debugging functionality is already provided by plugins! §Code::Blocks is here! (as of March 2014)

4 Code::Blocks functionality §Code::Blocks includes: l Code Editor l Compiler l Debugger l Other SW tools

5 Code::Blocks §How to Use?

6 Code::Blocks how to use §To download and set up Dev-C++: l Already installed in COS lab120

7 Code::Blocks how to use §To start Code::Blocks: l Start Menu >All Programs >CodeBlocks >CodeBlocks l Read and Close the “Tip of the Day” dialog box

8 Code::Blocks how to use To create project.cbp file l File > New > Project… l Select project category/type l Name the project – select project title l Locate the project – select folder to locate project in

9 Code::Blocks how to use §To add a new source file to an open project, in case your choice was Empty project l File > New > Empty File l Type the source text of C++ program. l Save the file File > Save As

10 Code::Blocks how to use §To add an existing file to an open project: l Project > Add Files… l Locate and then click the name of the file you want to add to the project, and then click the Open button

11 Code::Blocks how to use To run a C++ program: l Type your source text l Save your project: How? (File > Save All) l Compile the source: How? (Build > Build) l Read, Analyze Compiler Progress messages l Run the program: How? (Build > Run)

12 Code::Blocks how to use §To debug a C++ program: l If there are compiler errors, you should re-edit your source text in order to get successful compilation

13 Code::Blocks how to use §To print program’s instructions: l File > Print… l Dialog box opens (check box line numbers?)

14 Code::Blocks how to use §To close a project: l File > Close Project or l File > Close all Projects or l File > Close workspace

15 Code::Blocks how to use §To open an existing project,.cbp file: l File > Open… l Open File dialog box gets opened l Navigate to the folder that contains the project.cbp file l Click Open button

16 Code::Blocks §How to Configure?

17 Code::Blocks how to configure §Note: The asterisk on the MyFirstSourceFile.cpp tab indicates that the changes made to the file have not been saved.

18 Code::Blocks how to configure §NOTE: The font type and size used by default are Courier New and 14 point, respectively. If you want to change your editor window’s font type or size, click §Settings > Editor… > Editor settings tab, click Choose §When you are finished, click the OK button.

19 Code::Blocks how to configure §NOTE: You can change the appearance (for example, the font, size, colors, and so on) of the Command Prompt window by right-clicking the window’s title bar and then clicking Properties. §When you are finished, click the Ok button to close the Properties window.

20 Code::Blocks how to configure §NOTE:To display lines numbers in the editor window: §1. Settings > Editor… > Editor settings tab, §2. Section other options, select the Line Numbers check box.

21 Code::Blocks how to configure §Settings > Environment… §Settings > Editor… §Settings > Compiler… §Settings > Debugger…

22 Exercises/Tasks §Code::Blocks §Write a C++ program to: §display your personal data incl name, age, address §Read two numeric data items §Compute and display result of their addition, subtraction, multiplication, division and modulus (in case of integer data).

23 Exercises/Tasks §To demonstrate advantages of Code::Blocks §Back to MS Visual Studio §Write a C++ program to operate on arrays: #include using namespace std; void main() { int m; // int m=10; cin>>m; const int m=10; int arr[m]; for(int i=0; i<m; i++) { arr[i]=i*10; cout << arr[i] << ‘ ‘; } }

24 Exercises/Tasks §To demonstrate advantages of Code::Blocks §Back to Code::Blocks §Write a C++ program to operate on arrays: #include using namespace std; void main() { int m; // int m=10; cin>>m; const int m=10; int arr[m]; for(int i=0; i<m; i++) { arr[i]=i*10; cout << arr[i] << ‘ ‘; } }

25 Exercises/Tasks §To demonstrate command line arguments in Code::Blocks §Back to Code::Blocks §Write a C++ program: void main(int argc, char *argv[]) { for(int i=0; i<argc; i++) { cout << ‘\n’ << argv[i]; } } §Run the program without command-line arguments §Run the program with command-line arguments. How to specify? l Open cmd line window and run the program

26 Exercises/Tasks §Write CompactProg project to calculate l Factorilal: facti(7), factr(7) l GCD: gcdi(40,15), gcdr(40,15) l Fibonacci: fibi(5), fibr(5) §All functions and main() in the same file

27 Exercises/Tasks #include using namespace std; int factr(int); int facti(int);int gcdr(int, int); int fibr(int); int main(int argc, char *argv[]) { cout << factr(6) << “ “ << facti(6)<< “ “; cout << ‘\n’ << gcdr(40,15); cout,, ‘\n’ << fibr(5); system("PAUSE"); return EXIT_SUCCESS; }

28 Exercises/Tasks int factr(int n) { if (n==0 ) return 1; return n *factr(n-1); } int facti(int n) { if (n==0 ) return 1; int res=1; for (int i=1; i <=n; i++) res *=i; return res; }

29 Exercises/Tasks int gcdr(int m, int n) { if (n==0 ) return m; return gcdr(n, m%n); } int fibr(int n) { if (n==0 || n==1 ) return 1; return fibr(n-1) + fibr(n-2); }

30 Exercises/Tasks §To demonstrate: l How to create a static library l How to use a static library

31 Exercises/Tasks §Write SBCreateStaticLib project to create a static library.a file §All functions definitions in one or more files §File > New > Project… Select Static Library >Go §Type project title §Type folder to create project in §Select Debug / Release option §Build > Build Static library.a file gets created

32 File functions01.cpp // // factorial - recursion, iteration // int factr(int n) { if (n==0 ) return 1; return n *factr(n-1); } int facti(int n) { if (n==0 ) return 1; int res=1; for (int i=1; i <=n; i++) res *=i; return res; } // // greatest common divisor - recursion, iteration // int gcdr(int m, int n) { if (n==0 ) return m; return gcdr(n, m%n); } int fibr(int n) { if (n==0 || n==1 ) return 1; return fibr(n-1) + fibr(n-2); }

33 Exercises/Tasks §Write SBUseStaticLib project to use static library.a file §Source file – only main() function §File > New > Project… Select Console Application >Go §Type project title §Type folder to create project in §Select Debug / Release option §Attention! It’s must to add the user library file. How?

34 Exercises/Tasks §How? §1. To set the location of the user library file §2. to set the library name

35 Exercises/Tasks §1. To set the location of the user library file Settings >Compiler… > Search Directories tab select Linker Tab Add the folder where the library file is in

36 Exercises/Tasks §2. to set the library name Right click on the bolded project name Choose Build options Click the linker tab. Under the “Link libraries” window, press the “Add” button and add the library you wish your project to use. Press OK button

37 Exercises/Tasks §To run the application l Build > Build l Build > Run l Or l Build > Build and Run

38 File mainUseStaticLib01.cpp #include using namespace std; int facti(int), factr(int), fibr(int), gcdr(int, int); int main(int argc, char *argv[]) { cout << "\n Factoial = " << factr(6) << " " << facti(6); cout << "\n GCDivisor = " << gcdr(40,15); cout << "\n Fibonacci = " << fibr(4); system("PAUSE"); return EXIT_SUCCESS; }

39 Exercises/Tasks §To demonstrate: l How to create a second static library l How to use a second static library

40 File functions02.cpp #include void MyName() { std::cout << "\n\n My name is Stoyan\n"; } void MyAddress() { std::cout << "\n\n My address is 1504 Sofia, BG\n"; }

41 File mainUseStaticLib02.cpp #include using namespace std; void MyName(), MyAddress(); int main(int argc, char *argv[]) { MyName(); MyAddress(); system("PAUSE"); return EXIT_SUCCESS; }

42 Exercises/Tasks §To demonstrate: l How to use two static libraries in the same project

43 File mainUseTwoLibraries.cpp #include using namespace std; int facti(int), factr(int), fibr(int), gcdr(int, int); void MyName(), MyAddress(); int main(int argc, char *argv[]) { cout << "\n Factoial = " << factr(6) << " " << facti(6); cout << "\n GCDivisor = " << gcdr(40,15); cout << "\n Fibonacci = " << fibr(4); MyName(); MyAddress(); system("PAUSE"); return EXIT_SUCCESS; }

44 Thank You For Your Attention!