LCC-win32: Introduction
lcc-win32: Introduction | Compile unidelay | Drupal Cron |
lcc-win32 C compiler. |
LCC Introduction
On the forum someone asked the following question; what compiler was used to compile “unicontroller”? After looking through Uniform Server’s doc folder I discovered it was compiled using lcc-win32. Coincidentally I have just re-installed this to create a small delay utility. Lcc-win32 is a small but excellent free “C” development environment. At first sight it looks complicated however compared with commercial offerings it really is far easier to set-up and use.
This quick-start guide will show you how to set-up lcc-win32 and compile a small project.
Project
There’s no point in just reading, I like practical hence the project will be to create a small delay utility.
Every program you create requires a place to put all the files. Effectively you need to create a new folder within lcc's project folder.
First decide on a name you want to use for your project it can be anything you like, I will be using “uniform_server_delay”. Next choose a name for your program again this can be anything you like I want to produce a small utility named unidelay.exe.
With the project names defined we are ready to set-up the working environment, however first we need to install lcc-win32.
Download
Download a copy from Software Solution the file you are looking for is Lcc-win32 (lccwin2.exe) at the bottom of this page
Install
Installation is just a matter of a few mouse clicks.
- To start the installation process double click on lccwin32.exe
- Click Yes to continue, click Next
- Click Yes to licence Agreement
- Information click Next
- Select Destintion directory I selected drive E and used the default folder lcc. Click next
- Select Program Group. Change this if you want to. The default is fine, click Next
- Ready to install, click Install
Files are copied and the build process starts. Wait for this to end. - When libraries generation finishes an alert box is displayed. Click OK
- Click finished.
Run
Once installed run the program:
start > All Programs > Lcc-win32 > click Lcc-win32
Create a console project
I previously mentioned every program you create requires a place to put all the files (project name) and a program name defined as follows:
- Project name: uniform_server_delay
- Program name: unidelay
This is where that information is used:
Create project folder
Project set-up
Note: Of real importance is the first item Configuration; this opens a window with various tabs notably Compiler, Linker and Debugger see last three images on this page. |
|
Project folder set-up You will see there are three fields: Name of the project, Sources and Output directory. The following creates a project folder
|
|
Note: After clicking create, a pop-up displays "do you want to use the wizard" Click "Yes" This really does make life easier! Use it. |
Use the Wizard
Executable file name set-up An "Application characteristics" window opens.
Essentially that completes the set-up; all that remains is to click through reaming menus and accept their defaults. |
|||
Compiler Compiler settings page displayed click Next Note: When creating a new project the Complier page is displayed without tabs and the OK button is replaced with the Next button. Once you have completed and debugged your program the final stage is to change the settings on this page and recompile your project.
|
|||
Linker Linker settings page displayed click Next Note: When creating a new project the Linker page is displayed without tabs and the OK button is replaced with the Next button. Once you have completed and debugged your program the final stage is to change the settings on this page and recompile your project. After changing settings in the Compiler they are reflected in the Linker make sure the “Do not include the debug information” box (C) has been checked. |
|||
Debugger Debugger settings page displayed click Finish Note: When creating a new project the Debugger page is displayed without tabs and the OK button is replaced with the Finish. During development and debugging you can pass parameters to you application by entering them in box (A). These are the command line parameters you would enter when running your program |
After all that you end up with a single console page template.
OK you can delete its contents and add your own code. What is more important everything has been setup.
Folder hierarchy
For completeness I have included the project folder structure.
Sub-folder lcc When you compile your project several files are generated: Final note: You will notice I have created two other project folders unicontroller (windows application) After setting-up each project folder using the wizard I copied source code from Uniform Server's doc folder. |
Summary
I have shown how to install lcc-win32 and how easy it is to create a project using the wizard. Images I find help with orientation and provide a good reference point. With the project set-up its time to look at the source code and compiling this is covered on the next page.
Ric |