top of page

Grupo de Análise de Mercado

Público·40 membros

LCC Win32 ((BETTER))


Lcc-win32 is a freely available (for non-commercial use) C compiler (not C++). This page shows you how to install and use this compiler. Below are several steps that lead you through the installation.




LCC Win32



Lcc-win32 is not just a C compiler. It is actually a fairly complete IDE (Integrated Development Environment). If you want to, you can use the lcc-win32 compiler through the IDE. But the following steps show you how to access the lcc-win32 compiler from outside the IDE by using a programmer's text editor called TextPad as a kind of baby IDE. This way of writing and compiling C programs has some real advantages (mainly simplicity) when you are working on small programs.


Step 1: First you need to download three installer files. Put these files in some temporary location on your computer. (If you need to get started in a hurry, you do not really need the 2nd and 3rd files. You can get started with just the first file.)Lcc-win32 Compiler SystemC Standard Library help fileWindows API help file (12.8 MB) (No longer available?)


Step 2: Now run the installers in the order that they are listed above. Have the installers install your copy of lcc-win32 in the directory C:\lcc. Do not install lcc-win32 in the C:\Program Files directory. The space in that directory name can cause all kinds of problems.


Step 2.5 (Optional): The lcc-win32 installer creates a "lcc-win32" program group in your Start Menu. Look in this program group and start the program called lcc-win32. This starts up the IDE. If you wish, read the documentation that comes with the IDE (if you installed the documentation). Also, here is a very brief tutorial on using the IDE. I will not describe how to use the lcc-win32 IDE. Instead, the remaining steps show you how to use the TextPad editor as a simple IDE.


Step 5: Run TextPad by finding it in your Start Menu. Click on the Tools menu at the top of the TextPad window. Several "tools" are pre-installed by TextPad. We need to install five new tools that let us use lcc-win32 from within TextPad.


Step 6:We need to create a tool in TextPad to call the lcc-win32 compiler. Click on TextPad's "Configure -> Preferences..." menu item. In the left hand pane of the window that comes up, click on the word "Tools" (don't click on the + next to the word "Tools"). In the right hand pane, click on the "Add" drop down list and choose the item "Program...". In the file dialog box that comes up, navigate to the directory C:\lcc\bin and then in that directory double click on the program lcc.exe. Now you should be back to TextPad's "Preferences" window. Click on the button "Apply" at the bottom of this window. Now click on the + next to the word "Tools" in the left hand pane of the window. Under the word "Tools" you should have the item "lcc". Click on the item "lcc". This brings up a window where we can configure the "lcc" tool. In the text box labeled "Parameters:" enter the following text. (Note: Upper and lower case matter! The best way to enter the text is to use cut and paste from here to the text box.)-S -c -g2 $FileIn the text box labeled "Initial folder:" enter the following text:$FileDirMake sure that the check boxes labeled "Save all documents first" and "Capture output" are checked. In the text box labeled "Regular expression to match output:" (below all of the check boxes) enter the following text in place of what is currently there:^\(Error\Warning\) \([^:]+\): \([0-9]+\)Below this text box, set the small drop down list labelled "File" to 2, set the drop down list labelled "Line" to 3, and set the drop down list labelled "Column" to blank. Now click on the button "OK" at the bottom of the window. This completes the creation of the compiler tool. (You can check at this point and look in TextPad's "Tools" menu to see if the tool "lcc" is at the bottom of the menu list.)


Step 7:We need to create a tool in TextPad to call the lcc-win32 linker. Click on TextPad's "Configure -> Preferences..." menu item. In the left hand pane of the window that comes up, click on the word "Tools" (don't click on the + next to the word "Tools"). In the right hand pane, click on the "Add" drop down list and choose the item "Program...". In the file dialog box that comes up, navigate to the directory C:\lcc\bin and then in that directory double click on the program lcclnk.exe. Now you should be back to TextPad's "Preferences" window. Click on the button "Apply" at the bottom of this window. Now click on the + next to the word "Tools" in the left hand pane of the window. Under the word "Tools" you should have the item "lcclnk". Click on the item "lcclnk". This brings up a window where we can configure the "lcclnk" tool. In the text box labeled "Parameters:" enter the following text:-subsystem console -o $BaseName.exe $BaseName.objIn the text box labeled "Initial folder:" enter the following text:$FileDirMake sure that the check box labeled "Capture output" is checked. Now click on the button "OK" at the bottom of the window. This completes the creation of the linker tool.


Step 9:We need to create a tool in TextPad to use the Microsoft Win32 API help file that comes with lcc-win32. Click on TextPad's "Configure -> Preferences..." menu item. In the left hand pane of the window that comes up, click on the word "Tools" (don't click on the + next to the word "Tools"). In the right hand pane, click on the "Add" drop down list and choose the item "Online Help File...". In the file dialog box that comes up, navigate to the directory C:\lcc\bin and then in that directory double click on the help file win32.hlp. Now you should be back to TextPad's "Preferences" window. Click on the button "OK" at the bottom of this window. This completes the creation of the Win32 API help tool.


Step 10:We need to create a tool in TextPad to use the C Runtime Library help file that comes with lcc-win32. Click on TextPad's "Configure -> Preferences..." menu item. In the left hand pane of the window that comes up, click on the word "Tools" (don't click on the + next to the word "Tools"). In the right hand pane, click on the "Add" drop down list and choose the item "Online Help File...". In the file dialog box that comes up, navigate to the directory C:\lcc\bin and then in that directory double click on the help file c-library.chm. Now you should be back to TextPad's "Preferences" window. Click on the button "OK" at the bottom of this window. This completes the creation of the C Runtime Library help tool.


Step 11:When you cannot figure out what is wrong with a program that you wrote, it is nice to be able to run the program through a debugger. Lcc-win32 comes with a debugger in its IDE (see Step 2.5 above). We can create a tool for TextPad that lets us make use of this debugger. Click on TextPad's "Configure -> Preferences..." menu item. In the left hand pane of the window that comes up, click on the word "Tools" (don't click on the + next to the word "Tools"). In the right hand pane, click on the "Add" drop down list and choose the item "Program...". In the file dialog box that comes up, navigate to the directory C:\lcc\bin and then in that directory double click on the program wedit.exe. Now you should be back to TextPad's "Preferences" window. Click on the button "Apply" at the bottom of this window. Now click on the + next to the word "Tools" in the left hand pane of the window. Under the word "Tools" you should have the item "Wedit". Click on the item "Wedit". This brings up a window where we can configure the "Wedit" tool. In the text box labeled "Parameters:" enter the following text.$BaseName.exeMake sure that all the check boxes are unchecked. Now click on the button "OK" at the bottom of the window. After you have compiled and linked a program using the above tools, you can use this tool to run the program in the debugger from the lcc-win32 IDE.


Step 14: (optional) In Step 1, the compile tool has the "-S" option which tells the lcc-win32 compiler to create an assembly language listing of our program. Now we will create a tool to view this listing. Click on TextPad's "Configure -> Preferences..." menu item. In the left hand pane of the window that comes up, click on the word "Tools". In the right hand pane, click on the "Add" drop down list and choose the item "Program...". In the file dialog box that comes up, navigate to the directory C:\Program Files\TextPad 4 and then in that directory double click on the program TextPad.exe. Now you should be back to TextPad's "Preferences" window. Click on the button "Apply" at the bottom of this window. Now click on the + next to the word "Tools" in the left hand pane of the window. Under the word "Tools" you should have the item "Textpad". Click on the item "Textpad". In the text box labeled "Parameters:" enter the following text:$BaseName.asmIn the text box labeled "Initial folder:" enter the following text:$FileDirMake sure that all the check boxes are unchecked. Now click on the button "OK" at the bottom of the window. (If you want, give this tool a better name.)


Step 16:In Step 11 we created a tool to use the debugger built into the lcc-win32 IDE. However, if you have Microsoft's Visual Studio 6 installed on you computer, you can use the Visual Studio debugger on executables compiled and linked by lcc. In this step we will create a tool that opens for debugging in Visual Studio an executable compiled and linked by lcc. Click on TextPad's "Configure -> Preferences..." menu item. In the left hand pane of the window that comes up, click on the word "Tools". In the right hand pane, click on the "Add" drop down list and choose the item "Program...". In the file dialog box that comes up, navigate to the following directory:C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Binand then in that directory double click on the program MSDEV.EXE. Now you should be back to TextPad's "Preferences" window. Click on the button "Apply" at the bottom of this window. Now click on the + next to the word "Tools" in the left hand pane of the window. Under the word "Tools" you should have the item "Msdev". Click on the item "Msdev". In the text box labeled "Parameters:" enter the following text:$BaseName.exeIn the text box labeled "Initial folder:" enter the following text:$FileDirMake sure that all the check boxes are unchecked. Now click on the button "OK" at the bottom of the window. When you use this tool, after Visual Studio 6 opens, start the debugger with the "Build -> Start Debug -> Step Into" menu item. Note: If you want to debug your C program with parameters on its command line, then click the "Prompt for parameters" check box in the Msdev tool and put the parameters in the little dialog box that pops up when you use the tool. 041b061a72


Informações

Bem-vindo ao grupo! Você pode se conectar com outros membros...

membros

Página do grupo: Groups_SingleGroup
bottom of page