ebook img

borland :: borland C++ :: Borland C++ Version 3.1 Users Guide 1992 PDF

238 Pages·1992·9.4 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview borland :: borland C++ :: Borland C++ Version 3.1 Users Guide 1992

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 s N T E N T 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 Configuration and project files . . . . . .. 41 Starting and exiting the DOS IDE ...... 22 Using the SpeedBar ................ 41' Command-line options ............. 22 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 projects 131 Debugger ........................ 110 Sampling the Project Manager ........ 132 Directories ....................... 113 Error tracking. . . . . . . . . . . . . . . . . . . . .. 135 Resources . . . . . . . . . . . . . . . . . . . . . . .. 114 Stopping a make . . . . . . . . . . . . . . . . .. 135 Environment ..................... 114 Syntax errors in multiple source files . 135 Preferences ..................... 114 Saving or deleting messages . . . . . . .. 136 Editor ......................... 116 Autodependency checking ......... 137 Highlight ...................... 118 Using different file translators ........ 138 Coloring your text ............ 118 Changing translator options ... . . . .. 138 Using the Windows system Changing file translators ..... . . . . .. 139 colors ....................... 119 Assigning a new file translator . . . . .. 139 Changing text attributes ....... 119 Using the Project Manager to build Desktop ....................... 121 Windows applications .. . . . . . . . . . . . .. 140 Startup ........................ 121 Overriding libraries ................. 141 Colors ......................... 123 More Project Manager features ....... 141 Save ............................. 123 Looking at files in a project ......... 143 Window menu ..................... 124 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 ...... 183 Syntax and file names ............. 150 Copy propagation. . . . . . . . . . . . . .. 184 Response files .................... 151 Pointer aliasing . . . . . . . . . . . . . . . .. 184 Configuration files ................ 151 Induction-variable analysis and Option-precedence rules ......... 152 strength reductio"n .............. 186 Compiler options ................... 152 Loop compaction ............... 187 Memory model ................... 153 Code size versus speed Macro definitions ................. 154 optimizations .................. 187 Code-generation options . . . . . . . . . .. 155 Structure copy inlining .......... 187 The -v and -vi options . . . . . . . . . .. 159 Code compaction ............... 187 Optimization options .............. 160 Redundant load suppression ..... 188 Source-code options . . . . . . . . . . . . . .. 160 Intrinsic function inlining ........ 188 Error-reporting options ............ 162 Register parameter passing . . . . . .. 189 ANSI violations. . . . . . . . . . . . . . . .. 162 Object Data .................. 189 Frequenterrors ................. 163 The _fastcall modifier .......... 190 Portability warnings. . . . . . . . . . . .. 163 Parameter rules ............... 190 C++ warnings .................. 163 Function naming. . . . . . . . . . . . .. 191 Segment-naming control .. . . . . . . . .. 164 Appendix B Editor reference 193 Compilation-control options . . . . . . .. 165 Block commands ................ :. 195 Expanded and extended memory Other editing commands. . . . . . . . . .. 197 options .......................... 168 C++ virtual tables. . . . . . . . . . . . . . . .. 168 Appendix C Usin"g EasyWin 199 C++ member pointers ............. 169 DOS to Windows made easy ......... 199 Template-generation options ....... 171 Using EasyWin in a Windows Linker options . . . . . . . . . . . . . . . . . . . . .. 171 application ......................... 200 Environment options ................ 172 Added functions . . . . . . . . . . . . . . . . .. 201 Backward-compatibilityoptions ...... 173 Limitations. . . . . . . . . . . . . . . . . . . . . . . .. 201 Searching for include and library Appendix 0 Precompiled headers 203 files ............................. 174 File-search algorithms ............. 175 How they work . . . . . . . . . . . . . . . . . . . .. 203 An annotated example ........... 176 Drawbacks . . . . . . . . .. . . . . . . . . . . . .. 204 Using precompiled headers .......... 204 Appendix A The Optimizer 179 Setting file names ................. 205 When should you use the optimizer? . 179 Establishing identity .............. 205 Optimization options ................ 180 Optimizing precompiled headers 206 Backward compatibility .......... 181 Index 209 iv s T A B L E 2.1: General hot keys ................... 27 3.4: DLL interdependencies ........... 109 2.2: Menu hot keys .................... 27 4.1: Project Manager defaults in the DOS 2.3: Editing hot keys ................... 28 IDE .............................. 140 2.4: Window management hot keys ...... 28 4.2: Project Manager defaults in the 2.5: Online Help hot keys .............. 28 Windows IDE .................... 140 2.6: Debugging/Running hot keys ....... 29 5.1: Command-line options summary ... 147 2.7: Manipulating windows ............ 32 A.1: Optimization options summary .... 180 2.8: General hot keys .................. 40 A.2: Parameter types and possible registers 2.9: Editing hot keys ................... 40 used ........................... 191 2.10: Online Help hot keys .............. 40 B.1: Editing commands ............... 193 2.11: Compiling/Running hot keys ..... .40 B.2: Block commands in depth ......... 196 3.1: Information settings ............... 66 B.3: Borland-style block commands ..... 197 3.2: Expression qualifiers ............... 67 B.4: Other editor commands in depth ... 197 3.3: Format specifiers recognized in debugger expressions .............. 74 v u s F G R E 2.1: A typical window ................. 31 3.14: The Entry/Exit Code Generation dialog 2.2: A typical status line ................ 33 box ............................. 91 2.3: A sample dialog box .. ; ............ 34 3.15: The C++ Options dialog box ....... 93 3.1: The Open a File dialog box ......... .47 3.16: The Advanced C++ Options dialog 3.2: The Save File As dialog box ......... 49 box ............................. 95 3.3: The Change Directory dialog box .... 50 3.17: The Optimization Options dialog 3.4: The Find Text dialog box ........... 56 box ............................. 97 3.5: The Replace Text dialog box ........ 58 3.18: The Transfer dialog box ........... 102 3.6: The Breakpoints dialog box ...... ". .. 76 3.19: The Modify/New Transfer Item dialog 3.7: The Breakpoint Modify /New dialog box ............................ 103 box .............................. 77 3.20: The Make dialog box ............. 104 3.8: The Local Options dialog box ....... 79 3.21: The Linker dialog box ............ 106 3.9: The Borland C++ for Windows Local 3.22: The Libraries dialog box .......... 108 Options dialog box ................ 80 3.23: The Librarian Options dialog box .. 110 3.10: The Include Files dialog box ........ 81 3.24: The Debugger dialog box ......... 111 3.11: The Set Application Options dialog 3.25: The Highlighting dialog box ...... 118 box ............................. 85 3.26: The Startup Options dialog box ... 122 3.12: The Code Generation dialog box .... 87 3.27: The Colors dialog box ............ 123 3.13: The Advanced Code Generation dialog box ............................. 89 vi o u c o N T R D T N Borland C++ fully supports Borland C++ is a professional optimizing compiler for C++ and C Windows 3.1. developers. With Borland C++, you get both C++ (AT&T version 3.0 compliant) and ANSI C. It is a powerful, fast, and efficient compiler with which you can create practically any application, including Microsoft Windows applications. C++ is an object-oriented programming (OOP) language, and allows you to take advantage of OOP's advanced design methodology and labor-saving features. It's the next step in the natural evolution of C. It is portable, so you can easily transfer application programs written in C++ from one system to another. You can use C++ for almost any programming task, anywhere. What's in Borland C++ Chapter 1 tells you how to Borland C++ includes the latest features programmers have asked install Borland C++. This for: Introduction tells you where you can find out more about .. C and C++: Borland C++ offers you the full power of C and each of these features. C++ programming, with a complete implementation of the AT&T version 3.0 specification as well as a 100% ANSI C compiler. Borland C++ also provides a number of useful C++ class libraries, plus the first complete commercial implementation of templates, which allow efficient collection classes to be built using parameterized types. II Global optimization: A full suite of state-of-the-art optimization options gives you complete control over code generation, so you can program in the style you find most convenient, yet still .p roduce small, fast, highly efficient code . • Faster compilation speed: Borland C++ cuts compilation time for C++ by up to half. Precompiled headers significantly Introduction

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.