Unicon: Compile
Unicon: Introduction | Install | Compile |
Unicon |
Compile Unicon
Unicon is written in C and complied with lcc-win32 a powerful but easy to use program. These instructions provide a step-by-step guide to set-up a clean project on lcc-win32.
Note: This page lcc-win32 introduction is worth looking at before reading the following.
Create a new project
I have assumed lcc-win32 is installed on drive E, your location will be different just subsitute the appropricate drive.
- Create new folder named unicon located in the projects folder: E:\lcc\projects\unicon
- Start lcc-win32
- Close any open project: Projects > Close
- Create new project: File > New > Projects
- In Definition of new project window, enter the following:
- Name: unicon
- Source: Click brows button navigate to and select project folder unicon (as created in step 1)
- Output directory: This is automatically filled in for you.
- Type of project: Click Windows application radio button
- Click create
- Do you want to use wizzard: Click yes (Note: steps 7 to 14 are click-through)
- Application characteristics: Click Ok
- Class definition: Click Next
- Generate code for window creation: Click Finish
- lcc wizard: Click OK
- Compiler settings: Click Next
- Linker settings: Click Next
- Debugger settings: Click Finish
- Close lcc-win32: File > Quit
Add project files
From the folder where you extracted unicon_project.exe copy the following files:
- unicon.c
- Logo.bmp
- uslogo.ico
to lcc-win32 project folder E:\lcc\projects\unicon
(Note Drive letter will be different depending where you installed lcc-win32)
Add images to the resource file
- Start lcc-win32 project automatically opens
- Select: Design > Open/New
- Select: uniconres.h click Open
- Select: Design > New > icon
- Click brows, select uslogo.ico, Click Open
- Change Identity to: uslogo
- Check Set relative path mox
- Click OK
- Select: Design > New > bitmap
- Click brows, select Logo.bmp, Click Open
- Change Identity to: logo
- Check Set relative path box
- Click OK
- Select: File > Save all
A pop-up is displayed “file has changed reload from disk”: Click Yes - Select: Compiler > Make
This will display a “missing libraries” pop-up click Add libs (button bottom right) - Re-run make: Compiler > Make
Note the message unicon built successfully. - Select: Compiler > Execute unicon.exe
The program will run and display a pop-up "Apache file problem" this confirms program was compiled and runs successfully.
Click OK, time to add Uniform Server to the project.
Add Uniform Server to project
- Extract a copy of Uniform Server 3.5 to any folder.
- Open folder “Uniform Server” and copy all it's content to folder E:\lcc\projects\unicon\lcc
While in folder E:\lcc\projects\unicon\lcc delete the following files these are not required:
- Server_Start.bat
- Stop.bat
- UniController.exe
- Disk Start.vbs .
Do NOT delete “udrive” it contains Uniform Server.
You can now run unicon.exe either directly or from lcc-win32 (Compiler > Execute unicon.exe)
Note: Size of unicon.exe is large (approx 184K) this is because it contains debug information. After you have completed any modifications and tested change the compiler settings as follows:
- Project > Configuration
- Click Compiler tab
- Un-check the “Generate debug info” box
- Click OK a pop-up is displayed “Rebuild make file” click Yes
- Re-run make: Compiler > Make
- Note the size of unicon.exe reduces to about 67K
To further reduce size, while in Project > Configuration > Compiler tab
- Enable: Optimize
- Enable: Use Pentium pro instructions
- Enable: Eliminate unused assignments.
The reduction is small but still worth having.
Summary
The above provides a complete development environment where you can modify the existing utility or create a new one.
Remainder of this series provides code snippets, which will help in understanding the utility’s source code.
Ric |