Compiling a Native C++ Program on the Command Line #define #include.

Slides:



Advertisements
Similar presentations
Connecting to GMT machine via Windows 7. Windows PuTTy GMT on Mac server int-038.geosci.usyd.edu.au To use GMT, you will connect to a Mac server via PuTTy.
Advertisements

Stored procedures and views You can see definitions for stored procedures and views in the demo databases but you can’t change them. For views, expand.
Presentation Heading – font Arial
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
C Pre-Course Workshop Terence Lee QT406 -> PQ607
Programming Basics Aims of Programming: –The aim of programming is to write programs to accomplish complex tasks Programming method: –functional decompositional.
Your First C++ Program Aug 27, /27/08 CS 150 Introduction to Computer Science I C++  Based on the C programming language  One of today’s most.
Java Programming Working with TextPad. Using TextPad to Work with Java This text editor is designed for working with Java You can download a trial version.
Guidelines for working with Microsoft Visual Studio.Net.
Guidelines for working with Microsoft Visual Studio 6.
Introduction to Java.
Assembler Compiler Interpreter ASSEMBLER To convert the assembly language into machine code. Translate mnemonic operation codes to their machine language.
Creating a Console Application with Visual Studio
An Overview of the GAP Assessment Tool. Brief Description of the Tool  It is based on ISO  The assessment provides a checklist for an review of.
Chapter 1: Python Basics CSCI-UA 0002 – Introduction to Computer Programming Mr. Joel Kemp.
1 ENG236: ENG236: C++ Programming Environment (2) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.
Network Programming using NetLink Sockets C++ Library
Scoring Program Updates & XML upload to the NSRCA web site July 2013.
®® Microsoft Windows 7 for Power Users Tutorial 13 Using the Command-Line Environment.
1 C/C++ UM/MCSR. 2 Logging into the system using ssh Logging into the system from Windows: –Start the secure shell client: Start->Programs->SSH.
A1 Visual C++.NET Intro Programming in C++ Computer Science Dept Va Tech August, 2002 © Barnette ND & McQuain WD 1 Quick Introduction The following.
Integrated Development Environment (IDE)
TAMU CSCE 313 (the basics). Basic Unix/Linux programming Accessing CS systems  PuTTY (putty.exe) – a Telnet and SSH client  Common hosts: unix.cs.tamu.edu.
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.
Open a editor Write/Type the program Save the program with “.c” extension Compile the program (alt + F9) Run/Execute the program (ctrl + F9) Check the.
Using Microsoft Visual Studio 2005 Original by Suma Rao Revised by John G. McMahon ( 9/6/2008 )
C++ Workshop Sujana Jyothi Dept. of Computer Science.
Compiling a C Program. Before we can begin we must open a telnet session to phobos. There are a number of ways to do this, but the easiest is to click.
Using Microsoft Visual Studio C++ Express 2005 Name: Dr Ju Wang Ashwin Belle Course Resource:
N from what language did C++ originate? n what’s input, output device? n what’s main memory, memory location, memory address? n what’s a program, data?
Chapter 0 Getting Started. Objectives Understand the basic structure of a C++ program including: – Comments – Preprocessor instructions – Main function.
Using Macros in Minitab
1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.
Illustration of a Visual Basic Program Running an Ada Program 1 by Richard Conn 11 September 1999.
1 Programming Environment and Tools VS.Net 2012 First project MSDN Library.
Java Programming, Second Edition Appendix A Working with Java SDK 1.4.
Chapter 23. Copyright 2003, Paradigm Publishing Inc. CHAPTER 23 BACKNEXTEND 23-2 LINKS TO OBJECTIVES Record, Run, Pause, and Delete Macros Record, Run,
AE6382 MinGW l The MinGW (Minimalist GNU for Windows) GNU compilers u C/C++ u Fortran 77 u Fortran 95 l Generate native Windows code l User Windows libraries.
CPS120: Introduction to Computer Science Compiling a C++ Program From The Command Line.
1 How to Install OpenGL u Software running under Microsoft Windows makes extensive use of "dynamic link libraries." A dynamic link library (DLL) is a set.
Lab00-Getting Started with VC Launch VS 2005 Launch Visual Studio 2005 – Start > All Programs > Microsoft Visual Studio 2005 > Microsoft Visual.
SUPPLIER MODULE User’s Guide. Step 1. Click Files Step 2. Click Supplier.
This is how you invoke the Microsoft Visual Studio 2010 Software. All Programs >> Microsoft Visual Studio 2010.
1 Getting Started with C++ Part 2 Linux. 2 Getting Started on Linux Now we will look at Linux. See how to copy files between Windows and Linux Compile.
THE C PROGRAMMING ENVIRONMENT. Four parts of C environment  Main menu  Editor status line and edit window  Compiler message window  “Hot Keys” quick.
1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.
Open project in Microsoft Visual Studio → build program in “Release” mode.
How to Execute TSR Program. Install Borland C++ Download Borland C++ from LMS – oads/BORLANDC.rarhttp://vulms.vu.edu.pk/Courses/CS609/Downl.
 Memory setup  Pointer declaration  Address operator  Indirection  Printing addresses or pointers.
Downloading a Visual C compilers (try it yourself at home) Visual Studio 2012 can be found at:
DEPARTMENT MODULE User’s Guide. Step 1. Click Files Step 2. Click Department.
Chapter 10 Using Macros, Controls and Visual Basic for Applications (VBA) with Excel Microsoft Excel 2013.
COMPREHENSIVE Excel Tutorial 12 Expanding Excel with Visual Basic for Applications.
Linux CSE 1222 CSE1222: Lecture 1BThe Ohio State University1.
Tutorial 1 Writing Your First C++ Program CSC1110C Introduction to Computer Programming By Paul Pun Acknowledgement: Special thanks to Dr. Michael Fung.
Great way to learn is by example so fire up Visual Studios C (at home make sure you custom install with C++ - no longer default) by Deborah R. Fowler.
Computer Terms Review from what language did C++ originate?
Computer Programming Lecturer: Ir Dr Frank H.F. LEUNG
1. Open Visual Studio 2008.
Microsoft Visual Source Safe How & Why
Lab 1 Introduction to C++.
Double click Microsoft Visual Studio 2010 on the Computer Desktop
How to Execute TSR Program
How to Execute TSR Program
Compile and run c files.
Surviving MS DOS When lost, google it.
Presentation transcript:

Compiling a Native C++ Program on the Command Line #define #include

Compiling a Native C++ Program on the Command Line Open the Visual Studio 2010 Command Prompt window by clicking Start, pointing to All Programs, Microsoft Visual Studio 2010, Visual Studio Tools, and then clicking Visual Studio 2010 Command Prompt. – Some directories may require administrator credentials to create files. If you prefer to try the following commands with standard users’ privilege, change to a directory which allows you to create/modify files.

At the command prompt, type notepad basic.cpp and press Enter. – Click Yes when you are prompted to create a file. In Notepad, type the following lines. #include int main() { std::cout << "This is a native C++ program." << std::endl; return 0; } On the File menu, click Save. At the command prompt, type cl basic.cpp The cl.exe compiler generates an executable program named basic.exe. Type dir basic.* and press Enter. – The.obj file is an intermediate format file that you can safely ignore. To run the basic.exe program, type basic and press Enter.

C++ source (basic.cpp) macro expanded C++ source (basic.i) object code (basic.obj) Executable (basic.exe) CL /P CL /c CL Library

#define #include using std::cout; #defineAAA5 #defineF(x)printf("The value of " #x " is %d.\n", x) int main() { int a = 1, b = 2; for (int i=0; i<AAA; i++) cout << i << "\n"; F(a); F(b); return 0; }

#include CL /P b.cpp CL /c a.cpp a.cpp #include #include "b.cpp" #include "c.cpp" int main() { std::cout << CC << std::endl; return 0; } #define CC 329 b.cppc.cpp