Borland C/C++ Version 3.1 User Guide
Total Page:16
File Type:pdf, Size:1020Kb
3.1 USER'S GUIDE • INTEGRATED ENVIRONMENT • OPTIMIZATION • COMMAND·lINE COMPILER • INSTALLATION BORLAND Bar/ana C++ Version 3.1 BORLAND INTERNATIONAL, INC. 1800 GREEN HILLS ROAD P.O. BOX 660001, SCOTTS VALLEY, CA 95067-0001 Copyright © 1991, 1992 by Borland International. All rights reseNed. All Borland products are trademarks or registered trademarks of Borland International, Inc. Other brand and product names are trademarks or registered trademarks of their respective holders. Windows, as used in this manual, refers to Microsoft's implementation of a windows system. PRINTED IN THE USA. Rl 1098765 c o N T E N T s Introduction 1 The I e option ................... 23 What's in Borland C++ ................. 1 The Ih option ................... 23 Hardware and software requirements ... 4 The II option .................... 24 The Borland C++ implementation ....... 4 The 1m option. .. 24 The Borland C++ package . .. 5 The Ip option ................... 24 The User's Guide . .. 5 The Ir option .................... 24 The Tools and Utilities Guide ......... 6 The I s option. .. 24 The Programmer's Guide. .. 7 The I x option ................... 24 The Library Reference ............... 8 Exiting Borland C++ ............... 25 Using the manuals .................... 8 IDE components .. .. 25 Programmers learning C or C++ ...... 9 The menu bar and menus ........... 25 Experienced C and C++ programmers . 9 Shortcuts ....................... 26 Typefaces and icons used in these books . 10 Command sets .................. 26 How to contact Borland . .. 11 Native option ................. 29 Resources in your package .......... 11 Borland C++ windows. .. 30 Borland resources . .. 11 Window management ............ 32 The status line . .. 33 Chapter 1 Installing Borland C++ 13 Dialog boxes' . .. 33 Using INSTALL ..................... 14 Action buttons ................... 34 Protected mode and memory ... ... .. 15 Radio buttons and check boxes .... 34 DPMIINST .. .. .. .. .. .. .. .. ... 15 Input and list boxes .............. 35 DPMIMEM ..................... 16 Configuration and project files . .. 36 DPMIRES . .. 16. The configuratio~ file ............... 36 Extended and expanded memory .. 17 Project files .... '. .. 36 Running BC . .. 18 The project directory ............. 37 Laptop systems . .. 18 Desktop files .................... 37 The README file . .. 18 Changing project files ............ 38 The FILELIST.DOC and HELPME!.DOC Default files ..................... 38 files ................................ 19 The Borland C++ for Windows IDE .... 38 Example programs .................. 19 Starting Borland C++ for Windows . .. 39 Customizing the IDE ................. 19 Command-line options ........... 39 Chapter 2 IDE basics 21 Command sets .................... 39 Starting and exiting the DOS IDE ...... 22 Configuration and project files . .. 41 Command-line options ............. 22 Using the SpeedBar ................ 41' The Ib option ................... 22 Global buttons . .. 42 The I d option ................... 23 Desktop window ............... : 42 Edit windows ................... 42 Go to Cursor ................' ..... 61 Project window .................. 42 Trace Into ........................ 61 Message window ................ 43 Step Over ........................ 62 Arguments ....................... 63 Chapter 3 Menus and options Debugger ........................ 64 reference 45 Debugger Options ................ 64 :: (System) menu ... .. 46 Compile menu ..................... 64 Repaint Desktop ................... 46 Compile ......................... 64 Transfer items ..................... 46 Make ............................ 65 File menu . .. 47 Link ............................. 65 New ............................. '47 Build ............................ 65 Open ............................. 47 Information ...................... 66 Using the File list box ............... 48 Remove Messages ................. 66 Save .............................. 49 Debugmenu ....................... 66 Save As ........................... 49 Qualifying expressions ............ 67 SaveAll .......................... 49 Inspect .......................... 68 Change Dir ....................... 50 Ordinal Inspector windows ...... 69 Print ............................. 51 Pointer Inspector windows ....... 69 Printer Setup ...................... 51 Array Inspector windows ........ 70 DOS Shell . .. 51 Structure and Union Inspector Exit .............................. 52 windows ...................... 70 Closed file listing .................. 52 Function Inspector windows ..... 71 Edit menu .......................... 52 Class Inspector windows ......... 71 Undo ............................. 53 Constant Inspector window ...... 71 Redo ............................. 53 Type Inspector window .......... 71 Cut .............................. 54 Evaluate/Modify ................. 71 Copy ............................. 54 Call Stack ........................ 73 Paste .................... ',' ., ..... 54 Watches ......................... 75 Clear ............................. 54 Add Watch ..................... 75 Copy Example . .. 55 Delete Watch ................... 75 Show Clipboard ................... 55 EditWatch ..................... 75 Search menu ........................ 56 Remove All Watches ............ 76 Find .............................. 56 Toggle Breakpoint ................ 76 Replace ........................... 58 Breakpoints ...................... 76 Search Again ...................... , 58 Project menu ....................... 78 Go to Line Number ................ 59 Open Project ..................... 78 Previous Error . .. 59 Close Project ..................... 79 Next Error ........................ 59 Add Item ........................ 79 Locate Function .................... 59 Delete Item ...................... 79 Runmenu ......................... 59 Local Options .................... 79 Run ............................. 59 Include Files ..................... 81 Source code the same ............ 60 Browse menu ....................... 81 Sou~ce code modified ............ 60 Classes .......................... 82 Program Reset .................... 61 Functions ........................ 82 Variables ......................... 83 Size/Move . .. 124 Symbols .......................... 83 Zoom ........................... 124 Rewind ........................... 83 Tile ............................. 124 Overview .. .. 83 Cascade ......................... 125 Inspect ........................... 84 Arrange Icons .................... 125 Goto ............................. 84 Next ............................ 125 Options menu ....................... 84 Close ............................ 125 The Set Application Options dialog Close All . .. 125 box .............................. 84 Message ......................... 125 Compiler ......................... 86 Output .......................... 126 Code Generation . .. 86 Watch ........................... 126 Advanced Code Generation ...'.... 89 User Screen ...................... 127 Entry /Exit Code ................. 91 Register ......................... 127 C++ Options .................... 93 Project. .. .. 127 Advanced C++ Options. .. 95 Project Notes .. .. 127 Optimizations ................... 97 List All .......................... 127 Source ......................... 100 Help menu . .. 128 . Messages. .. 100 Contents . .. 129 Names ........................ 102 Index ............................ 129 Transfer ......................... 102 Topic Search ..................... 129 Transfer macros ................ 104 Previous Topic ................... 130 Make ............................ 104 Help on Help . .. 130 Linker ........................... 106 Active File ....................... 130 Settings . .. 106 About ........................... 130 Libraries ....................... 108 Chapter 4 Managing multi-file Librarian ........................ 110 Debugger ........................ 110 projects 131 Directories ....................... 113 Sampling the Project Manager ........ 132 Resources . .. 114 Error tracking. .. 135 Environment ..................... 114 Stopping a make . .. 135 Preferences ..................... 114 Syntax errors in multiple source files . 135 Editor ......................... 116 Saving or deleting messages . .. 136 Highlight ...................... 118 Autodependency checking ......... 137 Coloring your text ............ 118 Using different file translators ........ 138 Using the Windows system Changing translator options ... .. 138 colors ....................... 119 Changing file translators ..... .. 139 Changing text attributes ....... 119 Assigning a new file translator . .. 139 Desktop ....................... 121 Using the Project Manager to build Startup ........................ 121 Windows applications .. .. 140 Colors ......................... 123 Overriding libraries ................. 141 Save ............................. 123 More Project Manager features ....... 141 Window menu ..................... 124 Looking at files in a project ......... 143 Notes for your project ............. 143 iii Chapter 5 The command-line com- A closer look at the Borland C++ piler 145 Optimizer. .. 182 Using the command-line compiler ..... 145 Global register allocation. .. 182 DPMIINST . .. 146 Dead-code elimination. .. 182 Running BCC .................... 146 Common subexpression Using the options ................. 146 elimination ..................... 183 Option-precedence rules ......... 147 Loop invariant code motion