0,1410,21205,00.html
来自「C++builder学习资料C++builder」· HTML 代码 · 共 155 行
HTML
155 行
<HTML>
<HEAD>
<TITLE>Borland C++ 5.5 Free Command-line Tools Supplementary Information</TITLE>
</HEAD>
<BODY MARGINWIDTH="5" MARGINHEIGHT="5" TOPMARGIN="0" LEFTMARGIN="0" BGCOLOR="#FFFFFF">
<A NAME="top"></A>
<table>
<TR>
<td>
<b>
<SPAN CLASS="title3">Borland C++ 5.5 Free Command-line Tools Supplementary Information</SPAN>
<BR>
</b>
<P>
<BLOCKQUOTE CLASS="abstract"><B>Abstract:</B>Provides explicit instructions for setting up and using the free command-line compiler.</BLOCKQUOTE><P>
</table>
-------------------------------------------------------------------------------------------------
<br>--- Supplementary Information regarding Borland C++ 5.5 Command-line
Tools ---
<br>-------------------------------------------------------------------------------------------------
<p>To install the Borland C++ 5.5 Free Command-line Tools, simply double-click
on the downloaded file and choose all of the default options. After
the compiler installs to your hard disk, it must be configured following
the directions in the file README.TXT. Clarification of the instructions
found in that file are included below.
<p>Now, the compiler you downloaded is a command-line compiler application,
as distinguished from a Windows application. In Windows, usually
double-clicking on an icon or file is all that is necessary to execute
an application. Then, after the program loads, a graphical interface
is presented to the user.
<p>Console applications, on the other hand, accept various parameters and
switches that are typed in at the command line or from a batch file.
Though not as common under Windows, many operating systems, such as UNIX
or Linux use this format. Use of Borland C++ 5.5 assumes the user
is comfortable working within a console interface. Typically, the user
will run an application such as edit or Notepad to actually write their
program (an editor is not supplied with the compiler). When the user
wishes to compile source code, they save the file out as "filename.cpp"
and then use the command-line tools from within DOS to compile and create
an executable. Like so:
<p> bcc32 filename.cpp
<p>The first argument is name of the compiler tool, and the second argument
contains the C++ source file. This application will attempt to compile
the source code and will notify the user of any errors in the code.
If no errors are found it will create an executable. To display information
regarding the various switches, type "bcc32"
<p>------------------------------------------------------------------------------------------------------
<br>--- Step-by-step Instructions for Setting Up and Using the Command-Line
Compiler ---
<br>------------------------------------------------------------------------------------------------------
<p>Configuring the compiler for use:
<p> Open a console box.
<br> 1. Start | Run...
<br> 2. Type "command" into the field [Enter]
<p>* If Windows 95/98:
<br> Navigate to the root in order to modify the PATH reference in
the autoexec.bat file.
<br> 3. Type "cd" [Enter]
<br> 4. Type "edit autoexec.bat" [Enter]
<br> 5. Insert a line and type "PATH=C:\BORLAND\BCC55\BIN;%PATH%"
<br> 6. Save the changes (Alt-F then hit S).
<br> 7. Exit edit. (Alt+F then press X).
<p>* If Windows NT:
<br> Add a path reference to the Environment variables:
<br> 3. Using the mouse, right-click on the "My Computer" icon
(on your desktop) and choose "Properties".
<br> 4. Click on the "Environment" tab.
<br> 5. Click on "Path" in the "System Variables" field.
<br> 6. Highlight the "Path" System variable (bottom).
<br> 7. Click in the "Value" field.
<br> 5. Append the line with ";C:\BORLAND\BCC55\BIN;" (exactly 1
semi-colon between references)
<br> 6. Click on the "Set" button.
<br> 7. Click OK (in the "System Properties" window)
<p>* Or, if Windows 2000:
<br> Add a path reference to the Environment variables:
<br> 3. Using the mouse, right-click on the "My Computer" icon
(on your desktop) and choose "Properties".
<br> 4. Click on the "Advanced" tab.
<br> 5. Click on the "Environment Variables..." button.
<br> 6. Highlight the "Path" System variable (bottom).
<br> 7. Click on the "Edit..." button.
<br> 5. Append the line with ";C:\BORLAND\BCC55\BIN;"
<br> 6. Click OK (in the "Edit System Variables")
<br> 7. Click OK (in the "Environment Variables" window) and click OK (in the "System Properties" window) Navigating to the directory, "c:\Borland\bcc55\bin"
<br> 8. cd borland [Enter]
<br> 9. cd bcc55 [Enter]
<br> 10. cd bin [Enter]
<p> Creating the configuration files.
<br> Note: The command line should read: C:\BORLAND\BCC55\BIN
<p> Part 1: Creating BCC32.CFG.
<br> 9. Type "edit bcc32.cfg" [Enter] (This creates the
file and opens a blank window in the editor).
<br> 10. Add these lines:
<br> -I"c:\Borland\Bcc55\include"
<br> -L"c:\Borland\Bcc55\lib"
<br> 11. Save the changes (Alt-F then hit S).
<br> 12. Exit edit. (Alt+F then press X).
<p> Part 2: Creating ILINK32.CFG
<br> 13. Type "edit ilink32.cfg" (This creates the file and
opens a blank window in the editor).
<br> 14. Add these lines:
<br> -L"c:\Borland\Bcc55\lib"
<br> 15. Save the changes (Alt-F then hit S).
<br> 16. Exit edit. (Alt+F then press X).
<br> 17. Type "exit" [Enter]
<br> 18. Restart Windows.
<br>
<p>The following is an example of how to use the compiler:
<p> Open a console box.
<br> 1. Start | Run...
<br> 2. Type "command" into the field [Enter]
<p> Create a directory or navigate to where you want to store your
source.
<br> For example:
<br> 3. Type "cd"
<br> 4. Type "mkdir MySource"
<br> 5. cd Mysource
<br> (Now in c:\MySource)
<br>
<br> Create a new source file:
<br> For example:
<br> 6. Type "edit hello.cpp"
<br> 7. Paste or type the following code in the editor:
<p> #include <iostream.h>
<br> int main(void)
<br> {
<br> cout << "Hello." << endl;
<br> return 0;
<br> }
<p> 8. Save the changes (Alt-F then hit S).
<br> 9. Exit edit. (Alt+F then press X).
<p> Compiling the program to create an executable:
<br> 10. Type "bcc32 hello.cpp"
<p> Now, run the application you created.
<br> 11. Type "hello"
<br> (The output will appear below your last command line.)
<p>------------------------------------------------------------------------------------
<br>------------------------------------------------------------------------------------
<p>If you require additional resources, please refer to our newsgroups;
they are found at the following location:
<p> For issues regarding the command-line tools:
<br> news://forums.inprise.com/borland.public.cpp.commandlinetools
<p>------------------------------------------------------------------------------------
</body>
</HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?