home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 May / Chip_2002-05_cd1.bin / chplus / cpp / 3 / Tools.exe / bcc32.txt < prev    next >
Text File  |  1998-02-09  |  5KB  |  89 lines

  1. BCC32 Help
  2.  
  3. Note: For a more indepth description of the Compiler switches use the BCB online help.
  4.  
  5.  
  6. C++Builder includes BCC32.EXE, the Borland C++ command-line compiler.
  7.  
  8. Command-line compiler syntax
  9.  
  10. The syntax for BCC32 is:
  11.  
  12. BCC32 [option [option...]] filename [filename...]
  13.  
  14. Where:
  15.  
  16. Items enclosed in brackets are optional.
  17.     option refers to the command-line options.
  18.     filename refers to the source-code files you want to compile.
  19.  
  20. To see a list of the commonly used compiler options, type BCC32 at the command line (without any options or file names), then press Enter. This list displays the options that are enabled by default.
  21. The command-line compiler name, each option, and the file names must all be separated by at least one space. Precede each option by either a hyphen (-) or a forward slash (/). For example:
  22.  
  23. BCC32 -Ic:\code\hfiles
  24.  
  25. Options and file names entered on the command line override settings in configuration files.
  26. You can use BCC32 to send .OBJ files to TLINK32 or .ASM files to TASM32 (if you have TASM32 installed on your machine).
  27.  
  28. Default settings
  29.  
  30. BCC32.EXE has specific options that are on by default. To turn off a default option or to override options in a configuration file, follow the option with a minus (-) sign.
  31. Files without extensions and files with the .CPP extension compile as C++ files. Files with a .C extension or with extensions other than .CPP, .OBJ, .LIB, or .ASM compile as C files.
  32. The compilers try to link with a module-definition file with the same name as the executable. To link with a module-definition file with a different name, specify the name on the compiler command line. You must include the .DEF extension and you cannot link with more than one module-definition file.
  33.  
  34. If you repeatedly use a certain set of options, you can list them in a configuration file instead of continually typing them on the command line. A configuration file is a standard ASCII text file that contains one or more command-line options. Each option must be separated by a space or a new line.
  35. Whenever you issue a compile command, BCC32.EXE searches for a configuration file called BCC32.CFG. The compiler looks for the .CFG file first in the directory where you issue the compile command, then in the directory where the compiler is located.
  36.  
  37. You can create and use multiple configuration files in addition to using the default .CFG file. To use a configuration file, use the following syntax where you would place the compiler options:
  38.  
  39. +[path]filename
  40.  
  41. For example, you could use the following command line to use a configuration file called MYCONFIG.CFG:
  42.  
  43. BCC32 +C:\MYPROJ\MYCONFIG.CFG mycode.cpp
  44.  
  45. Options typed on the command line override settings stored in configuration files.
  46.  
  47. Response files let you list both compiler options and file names in a single file (unlike configuration files, which accept only compiler options). A response file is a standard ASCII text file that contains one or more command-line options and/or file names, with each entry in the file separated by a space or a new line. In addition to simplifying your compile commands, response files let you issue a longer command line than most operating systems allow.
  48. The syntax for using a single response file is:
  49.  
  50. BCC32 @[path]respfile.txt
  51.  
  52. The syntax for using multiple response files is:
  53.  
  54. BCC32 @[path]respfile.txt @[path]otheresp.txt
  55.  
  56. Response files shipped with C++Builder have an .RSP extension.
  57. Options typed at the command line override any option or file name in a response file.
  58.  
  59. The command-line compilers evaluate options from left to right, and follows these rules:
  60.     If you duplicate any option (except for the options -D, -U, -I, or -L), the last option typed overrides any earlier one. (-D, -U, -I, and -L are cumulative.)
  61.     Options typed at the command line override configuration and response file options.
  62.  
  63.  
  64. C++Builder can search multiple directories for include and library files. This means that the syntax for the library directories (-L) and include directories (-I) command-line options, like that of the #define option (-D), allows multiple listings of a given option. Here is the syntax for these options:
  65.  
  66. -Ldirname[;dirname;...]
  67.  
  68. -Idirname[;dirname;...]
  69.  
  70. The parameter dirname used with -L and -I can be any directory or directory path. You can enter these multiple directories on the command line in the following ways:
  71.  
  72. You can stack multiple entries with a single -L or -I option by using a semicolon:
  73.  
  74. BCC32.EXE -Ldirname1;dirname2;dirname3 -Iinc1;inc2;inc3 myfile.c
  75.  
  76. You can place more than one of each option on the command line, like this:
  77.  
  78. BCC32.EXE -Ldirname1 -Ldirname2 -Ldirname3 -Iinc1 -Iinc2 -Iinc3 myfile.c
  79.  
  80. You can mix listings:
  81.  
  82. BCC32.EXE -Ldirname1;dirname2 -Ldirname3 -Iinc1;inc2 -Iinc3 myfile.c
  83.  
  84. If you list multiple -L or -I options on the command line, the result is cumulative: The compiler searches all the directories listed, in order from left to right.
  85.  
  86. Note:    The C++Builder environment also supports multiple library directories. Use the Project Options and the Environment Options dialog boxes to enter the directories.
  87.  
  88.  
  89.