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.&nbsp; After  

the compiler installs to your hard disk, it must be configured following  

the directions in the file README.TXT.&nbsp; 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.&nbsp; In Windows, usually  

double-clicking on an icon or file is all that is necessary to execute  

an application.&nbsp; 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.&nbsp;  

Though not as common under Windows, many operating systems, such as UNIX  

or Linux use this format.&nbsp; 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).&nbsp; 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.&nbsp; Like so:  

<p>&nbsp; bcc32 filename.cpp  

<p>The first argument is name of the compiler tool, and the second argument  

contains the C++ source file.&nbsp; This application will attempt to compile  

the source code and will notify the user of any errors in the code.&nbsp;  

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>&nbsp;Open a console box.  

<br>&nbsp;1.&nbsp; Start | Run...  

<br>&nbsp;2.&nbsp; Type "command" into the field &#91;Enter&#93;  

<p>* If Windows 95/98:  

<br>&nbsp;Navigate to the root in order to modify the PATH reference in  

the autoexec.bat file.  

<br>&nbsp;3.&nbsp; Type "cd" &#91;Enter&#93;  

<br>&nbsp;4.&nbsp; Type "edit autoexec.bat" &#91;Enter&#93;  

<br>&nbsp;5.&nbsp; Insert a line and type "PATH=C:&#92BORLAND&#092BCC55&#092BIN;%PATH%"  

<br>&nbsp;6.&nbsp; Save the changes (Alt-F then hit S).  

<br>&nbsp;7.&nbsp; Exit edit. (Alt+F then press X).  

<p>* If Windows NT:  

<br>&nbsp;Add a path reference to the Environment variables:  

<br>&nbsp;3.&nbsp; Using the mouse, right-click on the "My Computer" icon  

(on your desktop) and choose "Properties".  

<br>&nbsp;4.&nbsp; Click on the "Environment" tab.  

<br>&nbsp;5.&nbsp; Click on "Path" in the "System Variables" field.  

<br>&nbsp;6.&nbsp; Highlight the "Path" System variable (bottom).  

<br>&nbsp;7.&nbsp; Click in the "Value" field.  

<br>&nbsp;5.&nbsp; Append the line with ";C:&#092BORLAND&#092BCC55&#092BIN;" (exactly 1  

semi-colon between references)  

<br>&nbsp;6.&nbsp; Click on the "Set" button.  

<br>&nbsp;7.&nbsp; Click OK (in the "System Properties" window)  

<p>* Or, if Windows 2000:  

<br>&nbsp;Add a path reference to the Environment variables:  

<br>&nbsp;3.&nbsp; Using the mouse, right-click on the "My Computer" icon  

(on your desktop) and choose "Properties".  

<br>&nbsp;4.&nbsp; Click on the "Advanced" tab.  

<br>&nbsp;5.&nbsp; Click on the "Environment Variables..." button.  

<br>&nbsp;6.&nbsp; Highlight the "Path" System variable (bottom).  

<br>&nbsp;7.&nbsp; Click on the "Edit..." button.  

<br>&nbsp;5.&nbsp; Append the line with ";C:&#092BORLAND&#092BCC55&#092BIN;"  

<br>&nbsp;6.&nbsp; Click OK (in the "Edit System Variables")  

<br>&nbsp;7.&nbsp; Click OK (in the "Environment Variables" window) and click OK (in the "System Properties" window) Navigating to the directory, "c:&#092Borland&#092bcc55&#092bin"  

<br>&nbsp;8.&nbsp; cd borland &#91;Enter&#93;  

<br>&nbsp;9.&nbsp; cd bcc55 &#91;Enter&#93;  

<br>&nbsp;10. cd bin &#91;Enter&#93;  

<p>&nbsp;Creating the configuration files.  

<br>&nbsp;Note: The command line should read:&nbsp; C:&#092BORLAND&#092BCC55&#092BIN  

<p>&nbsp;Part 1: Creating BCC32.CFG.  

<br>&nbsp;9.&nbsp; Type "edit bcc32.cfg" &#91;Enter&#93;&nbsp; (This creates the  

file and opens a blank window in the editor).  

<br>&nbsp;10. Add these lines:  

<br>&nbsp;&nbsp;-I"c:&#092Borland&#092Bcc55&#092include"  

<br>&nbsp;&nbsp;-L"c:&#092Borland&#092Bcc55&#092lib"  

<br>&nbsp;11. Save the changes (Alt-F then hit S).  

<br>&nbsp;12. Exit edit. (Alt+F then press X).  

<p>&nbsp;Part 2: Creating ILINK32.CFG  

<br>&nbsp;13. Type "edit ilink32.cfg"&nbsp; (This creates the file and  

opens a blank window in the editor).  

<br>&nbsp;14. Add these lines:  

<br>&nbsp;-L"c:&#092Borland&#092Bcc55&#092lib"  

<br>&nbsp;15. Save the changes (Alt-F then hit S).  

<br>&nbsp;16. Exit edit. (Alt+F then press X).  

<br>&nbsp;17. Type "exit" &#91;Enter&#93;  

<br>&nbsp;18. Restart Windows.  

<br>&nbsp;  

<p>The following is an example of how to use the compiler:  

<p>&nbsp;Open a console box.  

<br>&nbsp;1.&nbsp; Start | Run...  

<br>&nbsp;2.&nbsp; Type "command" into the field &#91;Enter&#93;  

<p>&nbsp;Create a directory or navigate to where you want to store your  

source.  

<br>&nbsp;For example:  

<br>&nbsp;3.&nbsp; Type "cd"  

<br>&nbsp;4.&nbsp; Type "mkdir MySource"  

<br>&nbsp;5.&nbsp; cd Mysource  

<br>&nbsp;(Now in c:&#092MySource)  

<br>&nbsp;  

<br>&nbsp;Create a new source file:  

<br>&nbsp;For example:  

<br>&nbsp;6.&nbsp; Type "edit hello.cpp"  

<br>&nbsp;7. Paste or type the following code in the editor:  

<p>&nbsp; #include &lt;iostream.h>  

<br>&nbsp; int main(void)  

<br>&nbsp; {  

<br>&nbsp;&nbsp; cout &lt;&lt; "Hello." &lt;&lt; endl;  

<br>&nbsp;&nbsp; return 0;  

<br>&nbsp; }  

<p>&nbsp;8. Save the changes (Alt-F then hit S).  

<br>&nbsp;9. Exit edit. (Alt+F then press X).  

<p>&nbsp;Compiling the program to create an executable:  

<br>&nbsp;10. Type "bcc32 hello.cpp"  

<p>&nbsp;Now, run the application you created.  

<br>&nbsp;11. Type "hello"  

<br>&nbsp;(The output will appear below your last command line.)  

<p>------------------------------------------------------------------------------------  

<br>------------------------------------------------------------------------------------  

<p>If you require additional resources, please refer to our newsgroups;&nbsp;  

they are found at the following location:  

<p>&nbsp; For issues regarding the command-line tools:  

<br>&nbsp; news://forums.inprise.com/borland.public.cpp.commandlinetools 

<p>------------------------------------------------------------------------------------ 

</body> 

  

</HTML> 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?