|
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.
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 a copy from Software Solution the file you are looking for is Lcc-win32 (lccwin2.exe) at the bottom of this page
Installation is just a matter of a few mouse clicks.
Once installed run the program:
start > All Programs > Lcc-win32 > click Lcc-win32
I previously mentioned every program you create requires a place to put all the files (project name) and a program name defined as follows:
This is where that information is used:
|
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. |
|
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.
|
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. |
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 |